From 1be2716f6e9a96959582d830c8e95c2e2313f622 Mon Sep 17 00:00:00 2001 From: sawka Date: Tue, 7 Nov 2023 16:15:54 -0800 Subject: [PATCH] add square icon back, fix spacing somewhat --- src/app/workspace/screen/screenview.less | 28 ++++++++++++++++++++++-- src/app/workspace/screen/screenview.tsx | 15 +++++-------- src/app/workspace/screen/tabs.less | 15 ++++++++++--- src/app/workspace/screen/tabs.tsx | 10 ++++++--- wavesrv/pkg/cmdrunner/cmdrunner.go | 4 ++-- 5 files changed, 53 insertions(+), 19 deletions(-) diff --git a/src/app/workspace/screen/screenview.less b/src/app/workspace/screen/screenview.less index aa92926c..60fd7236 100644 --- a/src/app/workspace/screen/screenview.less +++ b/src/app/workspace/screen/screenview.less @@ -143,9 +143,14 @@ .control-iconlist { display: flex; - padding: 8px 0; + margin-left: -2px; + padding: 8px 0 8px 2px; align-items: flex-start; - gap: 12px; + gap: 14px; + + &.tabicon-list { + gap: 12px; + } .icondiv { width: 20px; @@ -154,11 +159,30 @@ position: relative; font-size: 14px; + + &.tabicon { + display: flex; + align-items: center; + width: 22px; + } + .icon { width: 20px; height: 20px; } + i { + padding-left: 3px; + padding-right: 3px; + } + + .icon.square-icon { + position: relative; + top: 3px; + width: 16px; + height: 16px; + } + .check-icon { width: 12px; height: 12px; diff --git a/src/app/workspace/screen/screenview.tsx b/src/app/workspace/screen/screenview.tsx index 346f3a84..385b6a95 100644 --- a/src/app/workspace/screen/screenview.tsx +++ b/src/app/workspace/screen/screenview.tsx @@ -29,6 +29,7 @@ import { ReactComponent as StatusCircleIcon } from "../../assets/icons/statuscir import { ReactComponent as ArrowsUpDownIcon } from "../../assets/icons/arrowsupdown.svg"; import { ReactComponent as CircleIcon } from "../../assets/icons/circle.svg"; import { ReactComponent as AddIcon } from "../../assets/icons/add.svg"; +import { ReactComponent as SquareIcon } from "../../assets/icons/tab/square.svg"; import "./screenview.less"; import "./tabs.less"; @@ -114,10 +115,13 @@ class NewTabSettings extends React.Component<{ screen: Screen }, {}> { return ( <>
Select the icon
-
+
+
this.selectTabIcon("square")}> + +
this.selectTabIcon(icon || "")} @@ -173,13 +177,6 @@ class NewTabSettings extends React.Component<{ screen: Screen }, {}> { required={true} defaultValue={screen.name.get() ?? ""} onChange={this.updateName} - decoration={{ - endDecoration: ( - - - - ), - }} />
diff --git a/src/app/workspace/screen/tabs.less b/src/app/workspace/screen/tabs.less index 2a33c970..de0f6705 100644 --- a/src/app/workspace/screen/tabs.less +++ b/src/app/workspace/screen/tabs.less @@ -240,9 +240,18 @@ cursor: pointer; position: relative; - .icon { - width: 1.1em; - margin: 0 1em; + .icon.svg-icon { + margin: 0 12px; + + svg { + width: 14px; + height: 14px; + } + } + + .icon.fa-icon { + font-size: 16px; + margin: 0 12px; } .tab-name { diff --git a/src/app/workspace/screen/tabs.tsx b/src/app/workspace/screen/tabs.tsx index f51c24ea..89551185 100644 --- a/src/app/workspace/screen/tabs.tsx +++ b/src/app/workspace/screen/tabs.tsx @@ -104,11 +104,15 @@ class ScreenTabs extends React.Component<{ session: Session }, {}> { renderTabIcon = (screen: Screen): React.ReactNode => { const tabIcon = screen.getTabIcon(); - if (tabIcon === "default") { - return ; + if (tabIcon === "default" || tabIcon === "square") { + return ( +
+ +
+ ); } return ( -
+
); diff --git a/wavesrv/pkg/cmdrunner/cmdrunner.go b/wavesrv/pkg/cmdrunner/cmdrunner.go index f6133795..960cd2cd 100644 --- a/wavesrv/pkg/cmdrunner/cmdrunner.go +++ b/wavesrv/pkg/cmdrunner/cmdrunner.go @@ -72,7 +72,7 @@ const ( ) var ColorNames = []string{"yellow", "blue", "pink", "mint", "cyan", "violet", "orange", "green", "red", "white"} -var TabIcons = []string{"sparkle", "fire", "ghost", "cloud", "compass", "crown", "droplet", "graduation-cap", "heart", "file"} +var TabIcons = []string{"square", "sparkle", "fire", "ghost", "cloud", "compass", "crown", "droplet", "graduation-cap", "heart", "file"} var RemoteColorNames = []string{"red", "green", "yellow", "blue", "magenta", "cyan", "white", "orange"} var RemoteSetArgs = []string{"alias", "connectmode", "key", "password", "autoinstall", "color"} @@ -82,7 +82,7 @@ var GlobalCmds = []string{"session", "screen", "remote", "set", "client", "telem var SetVarNameMap map[string]string = map[string]string{ "tabcolor": "screen.tabcolor", - "tabicon": "screen.tabicon", + "tabicon": "screen.tabicon", "pterm": "screen.pterm", "anchor": "screen.anchor", "focus": "screen.focus",