From 2bade687f7a194a799b02c1f9c9867e33544bc0c Mon Sep 17 00:00:00 2001 From: mkpaz Date: Wed, 8 Feb 2023 19:17:03 +0400 Subject: [PATCH] Add menu/menubar paddings --- styles/src/components/_menu.scss | 10 ++++++++-- styles/src/nord-dark.scss | 3 ++- styles/src/nord-light.scss | 3 ++- styles/src/settings/_config.scss | 7 +++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/styles/src/components/_menu.scss b/styles/src/components/_menu.scss index 6edd4ca..6f5d47e 100755 --- a/styles/src/components/_menu.scss +++ b/styles/src/components/_menu.scss @@ -3,6 +3,7 @@ @use "../settings/config" as cfg; @use "../settings/effects"; @use "../settings/icons"; +@use "sass:math"; /////////////////////////////////////////////////////////////////////////////// // MenuBar // @@ -14,6 +15,8 @@ $color-menuitem-bg: -color-bg-default !default; $color-menuitem-bg-hover: if(cfg.$darkMode, -color-base-7, -color-base-1) !default; $separator-padding: map-get(cfg.$separators, "small") !default; +$menu-button-padding-x: cfg.$menu-padding-x - math.div(cfg.$menubar-padding-x, 2) !default; +$menu-button-padding-y: cfg.$menu-padding-y - math.div(cfg.$menubar-padding-y, 2) !default; .menu-bar { @@ -23,11 +26,13 @@ $separator-padding: map-get(cfg.$separators, "small") !default; -fx-padding: 0; >.container { + -fx-padding: cfg.$menubar-padding-y cfg.$menubar-padding-x cfg.$menubar-padding-y cfg.$menubar-padding-x; + >.menu-button { -fx-background-color: transparent; -fx-background-insets: 0 0 cfg.$border-width 0; - -fx-background-radius: 0; - -fx-padding: cfg.$menu-padding-y cfg.$menu-padding-x cfg.$menu-padding-y cfg.$menu-padding-x; + -fx-background-radius: cfg.$popup-radius; + -fx-padding: $menu-button-padding-y $menu-button-padding-x $menu-button-padding-y $menu-button-padding-x; // reset padding of menu buttons when in menu bar >.label { @@ -91,6 +96,7 @@ $separator-padding: map-get(cfg.$separators, "small") !default; .menu-item { -fx-background-color: $color-menuitem-bg; -fx-padding: cfg.$menu-padding-y cfg.$menu-padding-x cfg.$menu-padding-y cfg.$menu-padding-x; + -fx-background-radius: cfg.$popup-radius; >.graphic-container { -fx-padding: 0 cfg.$graphic-gap 0 0; diff --git a/styles/src/nord-dark.scss b/styles/src/nord-dark.scss index 011a352..dfcff78 100755 --- a/styles/src/nord-dark.scss +++ b/styles/src/nord-dark.scss @@ -130,7 +130,8 @@ $nord16: #B48EAD; // hsl(311, 20.2, 63.1) @forward "settings/config" with ( $darkMode: true, $border-radius: 1, - $opacity-disabled: 0.55 + $opacity-disabled: 0.55, + $popup-radius: 0 ); @use "general"; diff --git a/styles/src/nord-light.scss b/styles/src/nord-light.scss index 7917150..ad52ff6 100755 --- a/styles/src/nord-light.scss +++ b/styles/src/nord-light.scss @@ -133,7 +133,8 @@ $nord16: #B48EAD; // hsl(311, 20.2, 63.1) @forward "settings/config" with ( $darkMode: false, $border-radius: 1, - $opacity-disabled: 0.6 + $opacity-disabled: 0.6, + $popup-radius: 0 ); @use "general"; diff --git a/styles/src/settings/_config.scss b/styles/src/settings/_config.scss index 0496dfe..e21e177 100644 --- a/styles/src/settings/_config.scss +++ b/styles/src/settings/_config.scss @@ -50,10 +50,13 @@ $checkbox-mark-padding-x: 4px !default; $checkbox-label-padding: 2px !default; // menu -$popup-padding-x: 2px !default; -$popup-padding-y: 2px !default; +$popup-padding-x: 5px !default; +$popup-padding-y: 5px !default; $popup-shadow-radius: if($darkMode, 8px, 6px) !default; $popup-shadow-spread: if($darkMode, 0.6, 0.3) !default; +$popup-radius: 5px !default; +$menubar-padding-x: 4px !default; +$menubar-padding-y: 4px !default; $menu-padding-x: $padding-x !default; $menu-padding-y: $padding-y !default;