Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,13 @@ chmod +x nui-sftp-*.AppImage

#### Flatpak

For other distributions a flatpak is provided. Currently not in the official flathub, but that will come eventually.
Download the flatpak from a release and install it like so:
A flatpak is published on [Flathub](https://flathub.org/apps/org.nuicpp.nui_sftp) as `org.nuicpp.nui_sftp`:
```bash
flatpak install flathub org.nuicpp.nui_sftp
flatpak run org.nuicpp.nui_sftp
```

Flatpak bundles are also attached to each release if you prefer to install one directly:
```bash
# Make sure to pass the correct file name!
flatpak install nui-sftp-flatpak-x86_64_0.1.1.flatpak
Expand Down
48 changes: 48 additions & 0 deletions frontend/include/frontend/brand_mark.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#pragma once

#include <nui/frontend/attributes.hpp>
#include <nui/frontend/element_renderer.hpp>
#include <nui/frontend/svg_attributes.hpp>
#include <nui/frontend/svg_elements.hpp>

namespace Frontend
{
/**
* @brief Inline NuiSftp brand mark — a path + polygon filled with
* `currentColor` so the parent element's `color:` controls the tint and
* any `filter: drop-shadow(...)` on the parent applies cleanly.
*/
inline Nui::ElementRenderer brandMarkSvg()
{
namespace SvgEl = Nui::Elements::Svg;
namespace SvgAttr = Nui::Attributes::Svg;
using namespace Nui::Attributes::Literals;

return SvgEl::svg{
SvgAttr::viewBox = "0 0 500 500",
"aria-hidden"_attr = "true",
}(
SvgEl::g{
SvgAttr::transform = "matrix(1.4755152,0,0,1.4755152,-118.95322,-118.94235)",
SvgAttr::fill = "currentColor",
}(
SvgEl::path{
SvgAttr::d = "m 364.3,293.5 -0.3,0.4 -26.6,31.8 -22.6,26.8 -22.6,-26.8 "
"-26.6,-31.8 -0.3,-0.4 h 29 v -28.2 c 0.1,0 0.1,0 0.1,0 "
"l 0.2,-31.8 c -0.1,-3.2 -0.2,-6.4 -0.5,-9.7 -1.8,-26 "
"-24.3,-39.5 -47.2,-37.1 -25,2.5 -39.7,20.2 -41,46.3 "
"0,0.6 0,1.2 0,1.9 0,0.9 0,1.8 0,2.7 L 202,233 192.9,222.4 "
"c -0.2,-0.2 -0.3,-0.4 -0.6,-0.6 l -7.3,-8.7 -11.4,13.5 "
"-9.1,10.8 v -89.9 h 41.3 v 24.1 c 13.5,-17.2 33.5,-24.3 "
"55.6,-24.1 46.7,0.4 73,36.3 73.3,80.9 v 4.6 c 0,0 0.1,7.5 "
"0.1,7.5 v 24.8 c 0.1,0 0.3,28.2 0.3,28.2 h 29 z",
}(),
SvgEl::polygon{
SvgAttr::points = "164.7,292 135.7,292 136,291.6 162.6,259.8 185.1,233 "
"207.7,259.8 234.2,291.6 234.5,292 205.5,292 205.4,320.1 "
"205.2,352.5 185.1,352.3 165,352.5 164.9,320.1",
}()
)
);
}
}
16 changes: 4 additions & 12 deletions frontend/source/frontend/toolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <frontend/classes.hpp>
#include <frontend/session_area.hpp>
#include <frontend/state_holder_with_dialog.hpp>
#include <frontend/components/icon_panel.hpp>
#include <frontend/events/frontend_events.hpp>
#include <frontend/dialog/direct_connect_dialog.hpp>
#include <utility/language.hpp>
Expand All @@ -15,6 +14,7 @@

#include <frontend/onboarding/onboarding.hpp>

#include <frontend/brand_mark.hpp>
#include <frontend/svgs/add.hpp>
#include <frontend/svgs/decline.hpp>
#include <frontend/svgs/settings.hpp>
Expand Down Expand Up @@ -192,17 +192,9 @@ Nui::ElementRenderer Toolbar::operator()()

// clang-format off
return div{class_ = "toolbar"}(
iconPanel({
.icon = [](){
return img{
src = "nui://app.example/icons/nui-sftp-logo.svg",
style = "width: 32px; height: 32px;",
}();
}(),
.color = "var(--theme-color)",
.padding = 0,
.withBorder = false
}),
div{class_ = "toolbar-brand-mark"}(
Frontend::brandMarkSvg()
),
Snc::select(Snc::SelectOptions<decltype(impl_->activeTerminalEngine), decltype(impl_->terminalEngines)>{
.activeOption = impl_->activeTerminalEngine,
.options = impl_->terminalEngines,
Expand Down
22 changes: 22 additions & 0 deletions static/styles/toolbar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.toolbar {
grid-area: Toolbar;
display: flex;
align-items: center;
border-bottom: 1px solid var(--border-color-fields);
background-color: var(--background-color);
gap: 5px;
Expand All @@ -9,4 +10,25 @@
&>.script-nui-select {
min-width: 200px;
}
}

/* Inline brand-mark shown at the left of the toolbar. Defaults to a flat
theme-tinted plate; themes (e.g. Nebula) override the chrome for richer
looks. */
.toolbar-brand-mark {
width: 36px;
height: 36px;
border-radius: 6px;
display: grid;
place-items: center;
color: var(--theme-color);
background: color-mix(in srgb, var(--theme-color) 18%, var(--background-color));
overflow: hidden;
flex-shrink: 0;
}

.toolbar-brand-mark svg {
width: 78%;
height: 78%;
display: block;
}
Loading
Loading