[gnome-text-editor] openpopover: simplify popover styling
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-text-editor] openpopover: simplify popover styling
- Date: Thu, 2 Dec 2021 01:20:31 +0000 (UTC)
commit 481ef92469e6505b49f4baa19c5e4f2091968760
Author: Christian Hergert <chergert redhat com>
Date: Wed Dec 1 17:17:50 2021 -0800
openpopover: simplify popover styling
This makes things look closer to a GtkDropDown but with more complicated
menu items.
Related #229
src/TextEditor.css | 11 ++++----
src/editor-open-popover.ui | 70 ++++++++++++++++------------------------------
2 files changed, 30 insertions(+), 51 deletions(-)
---
diff --git a/src/TextEditor.css b/src/TextEditor.css
index bef1aaf..72efee2 100644
--- a/src/TextEditor.css
+++ b/src/TextEditor.css
@@ -67,15 +67,15 @@
.org-gnome-TextEditor .open-popover contents {
padding: 0;
}
-.org-gnome-TextEditor .open-popover scrolledwindow scrollbar.vertical {
- margin-top: 3px;
+.org-gnome-TextEditor .open-popover list {
margin-bottom: 3px;
}
.org-gnome-TextEditor .open-popover list row {
- border-bottom: 1px solid alpha(@borders, 0.4);
+ border-radius: 9px;
+ margin: 3px 6px;
}
-.org-gnome-TextEditor .open-popover list row:last-child {
- border-bottom: none;
+.org-gnome-TextEditor .open-popover list row:first-child {
+ margin-top: 6px;
}
.org-gnome-TextEditor .open-popover list row button {
padding: 3px;
@@ -83,6 +83,7 @@
min-height: 24px;
min-width: 24px;
}
+.org-gnome-TextEditor .open-popover list row:hover,
.org-gnome-TextEditor .open-popover list row:focus {
background: alpha(currentColor, .07);
}
diff --git a/src/editor-open-popover.ui b/src/editor-open-popover.ui
index 1b6d4cf..253587f 100644
--- a/src/editor-open-popover.ui
+++ b/src/editor-open-popover.ui
@@ -14,10 +14,10 @@
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">6</property>
- <property name="margin-top">9</property>
- <property name="margin-bottom">9</property>
- <property name="margin-start">24</property>
- <property name="margin-end">24</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">6</property>
+ <property name="margin-start">6</property>
+ <property name="margin-end">6</property>
<child>
<object class="GtkSearchEntry" id="search_entry">
<property name="hexpand">True</property>
@@ -44,23 +44,12 @@
<property name="vhomogeneous">false</property>
<property name="hhomogeneous">false</property>
<child>
- <object class="GtkFrame" id="empty">
- <property name="margin-top">24</property>
- <property name="margin-bottom">24</property>
- <property name="margin-start">24</property>
- <property name="margin-end">24</property>
- <style>
- <class name="card"/>
- </style>
- <child>
- <object class="GtkLabel">
- <property name="label" translatable="yes">No Recent Documents</property>
- <property name="margin-start">6</property>
- <property name="margin-top">12</property>
- <property name="margin-bottom">12</property>
- <property name="margin-end">6</property>
- </object>
- </child>
+ <object class="GtkLabel" id="empty">
+ <property name="label" translatable="yes">No Recent Documents</property>
+ <property name="margin-start">6</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-end">6</property>
</object>
</child>
<child>
@@ -75,31 +64,20 @@
<child>
<object class="GtkViewport">
<child>
- <object class="GtkFrame">
- <property name="margin-top">24</property>
- <property name="margin-bottom">24</property>
- <property name="margin-start">24</property>
- <property name="margin-end">24</property>
- <style>
- <class name="card"/>
- </style>
- <child>
- <object class="GtkListBox" id="list_box">
- <signal name="row-activated" handler="on_list_box_row_activated_cb"
swapped="true" object="EditorOpenPopover"/>
- <property name="activate-on-single-click">True</property>
- <property name="selection-mode">none</property>
- <child type="placeholder">
- <object class="GtkLabel">
- <property name="label" translatable="yes">No Results Found</property>
- <property name="margin-start">6</property>
- <property name="margin-top">42</property>
- <property name="margin-bottom">42</property>
- <property name="margin-end">6</property>
- <style>
- <class name="dim-label"/>
- </style>
- </object>
- </child>
+ <object class="GtkListBox" id="list_box">
+ <signal name="row-activated" handler="on_list_box_row_activated_cb" swapped="true"
object="EditorOpenPopover"/>
+ <property name="activate-on-single-click">True</property>
+ <property name="selection-mode">none</property>
+ <child type="placeholder">
+ <object class="GtkLabel">
+ <property name="label" translatable="yes">No Results Found</property>
+ <property name="margin-start">6</property>
+ <property name="margin-top">18</property>
+ <property name="margin-bottom">18</property>
+ <property name="margin-end">6</property>
+ <style>
+ <class name="dim-label"/>
+ </style>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]