[libadwaita/wip/exalm/stylesheet2: 63/97] stylesheet: Split dropdown styles into a separate file
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libadwaita/wip/exalm/stylesheet2: 63/97] stylesheet: Split dropdown styles into a separate file
- Date: Fri, 9 Apr 2021 12:30:25 +0000 (UTC)
commit 513646ebfee93bd49cc63ef23b2200ae418462f6
Author: Alexander Mikhaylenko <alexm gnome org>
Date: Fri Apr 9 12:49:00 2021 +0500
stylesheet: Split dropdown styles into a separate file
src/stylesheet/_common.scss | 102 ---------------------------------
src/stylesheet/_widgets.scss | 1 +
src/stylesheet/meson.build | 1 +
src/stylesheet/widgets/_dropdowns.scss | 97 +++++++++++++++++++++++++++++++
4 files changed, 99 insertions(+), 102 deletions(-)
---
diff --git a/src/stylesheet/_common.scss b/src/stylesheet/_common.scss
index 13df56e..c7f3b0a 100644
--- a/src/stylesheet/_common.scss
+++ b/src/stylesheet/_common.scss
@@ -233,108 +233,6 @@ editablelabel > stack > text {
@include entry(normal);
}
-/**************
- * ComboBoxes *
- **************/
-dropdown > popover.menu.background > contents { padding: 0; }
-
-dropdown > button > box {
- border-spacing: 6px;
-}
-
-dropdown,
-combobox {
- arrow {
- -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
- min-height: 16px;
- min-width: 16px;
- }
-
- // align menu labels with the button label
- > popover.menu > contents modelbutton {
- padding-left: 9px;
- padding-right: 9px;
- }
-
- &.linked {
- button:nth-child(2) {
- &:dir(ltr) { @extend %linked_not_left; }
- &:dir(rtl) { @extend %linked_not_right; }
- }
- }
-
- &:drop(active) { // FIXME: untested
- box-shadow: none;
-
- button.combo { @extend %button_basic_drop_active; }
- }
-
- // newstyle
- popover {
- margin-top: 6px;
- padding: 0;
-
- listview {
- padding: 8px 0;
-
- & > row {
- padding: 8px;
-
- &:selected {
- outline-color: $alt_focus_border_color;
- color: $text-color;
- background-color: $menu_selected_color;
- }
- }
- }
-
- // dropdowns with searchboxes on top
- .dropdown-searchbar {
- padding: 6px;
- border-bottom: 1px solid $borders_color;
- }
- }
-}
-
-
-// the combo is a composite widget so the way we do button linking doesn't
-// work, special case needed. See
-// https://bugzilla.gnome.org/show_bug.cgi?id=733979
-
-.linked:not(.vertical) > combobox {
- &:dir(ltr) {
- &:not(:first-child) > box > button.combo { @extend %linked_not_left; }
- &:not(:last-child) > box > button.combo { @extend %linked_not_right; }
- }
-
- &:dir(rtl) {
- &:not(:first-child) > box > button.combo { @extend %linked_not_right; }
- &:not(:last-child) > box > button.combo { @extend %linked_not_left; }
- }
-}
-
-.linked.vertical > combobox {
- &:not(:first-child) > box > button.combo { @extend %linked_not_top; }
- &:not(:last-child) > box > button.combo { @extend %linked_not_bottom; }
-}
-
-.linked:not(.vertical) > appchooserbutton {
- &:dir(ltr) {
- &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_left; }
- &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_right; }
- }
-
- &:dir(rtl) {
- &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_right; }
- &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_left; }
- }
-}
-
-.linked.vertical > appchooserbutton {
- &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_top; }
- &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_bottom; }
-}
-
/************
* Toolbars *
diff --git a/src/stylesheet/_widgets.scss b/src/stylesheet/_widgets.scss
index f4db69e..4947f2b 100644
--- a/src/stylesheet/_widgets.scss
+++ b/src/stylesheet/_widgets.scss
@@ -1,4 +1,5 @@
@import 'widgets/buttons';
+@import 'widgets/dropdowns';
@import 'widgets/entries';
@import 'widgets/links';
@import 'widgets/spinner';
diff --git a/src/stylesheet/meson.build b/src/stylesheet/meson.build
index e3e5e4e..0a8c7ae 100644
--- a/src/stylesheet/meson.build
+++ b/src/stylesheet/meson.build
@@ -21,6 +21,7 @@ if not fs.exists('Adwaita-light.css')
'_widgets.scss',
'widgets/_buttons.scss',
+ 'widgets/_dropdowns.scss',
'widgets/_entries.scss',
'widgets/_links.scss',
'widgets/_spinner.scss',
diff --git a/src/stylesheet/widgets/_dropdowns.scss b/src/stylesheet/widgets/_dropdowns.scss
new file mode 100644
index 0000000..9033e02
--- /dev/null
+++ b/src/stylesheet/widgets/_dropdowns.scss
@@ -0,0 +1,97 @@
+dropdown > popover.menu.background > contents { padding: 0; }
+
+dropdown > button > box {
+ border-spacing: 6px;
+}
+
+dropdown,
+combobox {
+ arrow {
+ -gtk-icon-source: -gtk-icontheme('pan-down-symbolic');
+ min-height: 16px;
+ min-width: 16px;
+ }
+
+ // align menu labels with the button label
+ > popover.menu > contents modelbutton {
+ padding-left: 9px;
+ padding-right: 9px;
+ }
+
+ &.linked {
+ button:nth-child(2) {
+ &:dir(ltr) { @extend %linked_not_left; }
+ &:dir(rtl) { @extend %linked_not_right; }
+ }
+ }
+
+ &:drop(active) { // FIXME: untested
+ box-shadow: none;
+
+ button.combo { @extend %button_basic_drop_active; }
+ }
+
+ // newstyle
+ popover {
+ margin-top: 6px;
+ padding: 0;
+
+ listview {
+ padding: 8px 0;
+
+ & > row {
+ padding: 8px;
+
+ &:selected {
+ outline-color: $alt_focus_border_color;
+ color: $text-color;
+ background-color: $menu_selected_color;
+ }
+ }
+ }
+
+ // dropdowns with searchboxes on top
+ .dropdown-searchbar {
+ padding: 6px;
+ border-bottom: 1px solid $borders_color;
+ }
+ }
+}
+
+// the combo is a composite widget so the way we do button linking doesn't
+// work, special case needed. See
+// https://bugzilla.gnome.org/show_bug.cgi?id=733979
+
+.linked:not(.vertical) > combobox {
+ &:dir(ltr) {
+ &:not(:first-child) > box > button.combo { @extend %linked_not_left; }
+ &:not(:last-child) > box > button.combo { @extend %linked_not_right; }
+ }
+
+ &:dir(rtl) {
+ &:not(:first-child) > box > button.combo { @extend %linked_not_right; }
+ &:not(:last-child) > box > button.combo { @extend %linked_not_left; }
+ }
+}
+
+.linked.vertical > combobox {
+ &:not(:first-child) > box > button.combo { @extend %linked_not_top; }
+ &:not(:last-child) > box > button.combo { @extend %linked_not_bottom; }
+}
+
+.linked:not(.vertical) > appchooserbutton {
+ &:dir(ltr) {
+ &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_left; }
+ &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_right; }
+ }
+
+ &:dir(rtl) {
+ &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_right; }
+ &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_left; }
+ }
+}
+
+.linked.vertical > appchooserbutton {
+ &:not(:first-child) > combobox > box > button.combo { @extend %linked_not_top; }
+ &:not(:last-child) > combobox > box > button.combo { @extend %linked_not_bottom; }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]