[dconf-editor] Split BaseWindow and friends CSS.
- From: Arnaud B. <arnaudb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf-editor] Split BaseWindow and friends CSS.
- Date: Mon, 14 Jan 2019 10:50:14 +0000 (UTC)
commit 00f13c156be7a26ac112b381c5e8abbb68e462dd
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date: Sun Jan 13 06:47:00 2019 +0100
Split BaseWindow and friends CSS.
For the BaseWindow class to be usable as a library,
its CSS classes need moving in a specific CSS file.
editor/base-window.css | 131 ++++++++++++++++++++++++++++++++++++++
editor/dconf-editor.css | 100 +----------------------------
editor/dconf-editor.gresource.xml | 1 +
editor/meson.build | 12 +++-
editor/overlayed-list.vala | 2 +
5 files changed, 144 insertions(+), 102 deletions(-)
---
diff --git a/editor/base-window.css b/editor/base-window.css
new file mode 100644
index 0000000..139ac0c
--- /dev/null
+++ b/editor/base-window.css
@@ -0,0 +1,131 @@
+/*
+ This file is part of Dconf Editor
+
+ Dconf Editor is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Dconf Editor is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Dconf Editor. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+/*\
+* * center widget revealers
+\*/
+
+/* hack: fix the double space when the child of the revealer is hidden; 6px is the spacing of the
centerwidget box */
+.centerwidget:dir(ltr) .headerbar-revealer { padding-right:6px; }
+.centerwidget:dir(rtl) .headerbar-revealer { padding-left :6px; }
+
+.centerwidget:dir(ltr) { margin-right:-6px; }
+.centerwidget:dir(rtl) { margin-left :-6px; }
+
+/*\
+* * app notification
+\*/
+
+.extra-small-window .app-notification,
+ .small-window .app-notification {
+ border-radius:0;
+}
+
+/*\
+* * overlayed list
+\*/
+
+ .vertical.overlayed-list.needs-padding > scrolledwindow > viewport > list {
+ padding-bottom:0;
+ transition:padding-bottom 0.3s,
+ font-size 0.3s;
+}
+ .vertical.overlayed-list.needs-padding > scrolledwindow > viewport > list:not(.empty-list) {
+ padding-bottom:3rem;
+}
+ .vertical.overlayed-list.needs-padding > .linked-circular {
+ margin-bottom:0.3rem;
+}
+
+.horizontal.overlayed-list:dir(ltr).needs-padding > scrolledwindow > viewport > list > row {
+ padding-right:calc(160px+1rem); /* width-request of edit_mode_box + a bit */
+}
+.horizontal.overlayed-list:dir(rtl).needs-padding > scrolledwindow > viewport > list > row {
+ padding-left :calc(160px+1rem); /* width-request of edit_mode_box + a bit */
+}
+.horizontal.overlayed-list:dir(ltr).needs-padding > .linked-circular {
+ margin-right:1.5rem;
+}
+.horizontal.overlayed-list:dir(rtl).needs-padding > .linked-circular {
+ margin-left :1.5rem;
+}
+
+ .vertical.overlayed-list:dir(rtl) > .linked-circular > .right-on-ltr,
+ .vertical.overlayed-list:dir(ltr) > .linked-circular > .left-on-ltr {
+ border-radius:2rem 0 0 2rem;
+ -gtk-outline-top-left-radius :2rem;
+ -gtk-outline-bottom-left-radius:2rem;
+}
+
+ .vertical.overlayed-list:dir(ltr) > .linked-circular > .right-on-ltr,
+ .vertical.overlayed-list:dir(rtl) > .linked-circular > .left-on-ltr {
+ border-radius:0 2rem 2rem 0;
+ -gtk-outline-top-right-radius :2rem;
+ -gtk-outline-bottom-right-radius:2rem;
+}
+
+.horizontal.overlayed-list:dir(rtl) > .linked-circular > .right-on-ltr,
+.horizontal.overlayed-list:dir(ltr) > .linked-circular > .left-on-ltr {
+ border-radius:1.5rem 1.5rem 0 0;
+ -gtk-outline-top-right-radius:1.4rem;
+ -gtk-outline-top-left-radius :1.4rem;
+}
+.horizontal.overlayed-list:dir(ltr) > .linked-circular > .right-on-ltr,
+.horizontal.overlayed-list:dir(rtl) > .linked-circular > .left-on-ltr {
+ border-radius:0 0 1.5rem 1.5rem;
+ -gtk-outline-bottom-right-radius:1.4rem;
+ -gtk-outline-bottom-left-radius :1.4rem;
+}
+
+/*\
+* * in-window about
+\*/
+
+.about-list > scrolledwindow > viewport > list > row {
+ min-height:1.3rem;
+}
+
+.about-list > scrolledwindow > viewport > list > row > label {
+ margin:4px;
+}
+
+.about-list > scrolledwindow > viewport > list > row > button {
+ margin-top:2px;
+ margin-bottom:2px;
+}
+
+/*\
+* * text formating
+\*/
+
+.small-label {
+ font-size:small;
+}
+.bold-label {
+ font-weight:bold;
+}
+.italic-label {
+ font-style:italic;
+}
+
+.big-popover {
+ font-size:144%;
+}
+
+/*\
+* * the end
+\*/
diff --git a/editor/dconf-editor.css b/editor/dconf-editor.css
index 040f8ab..76142e9 100644
--- a/editor/dconf-editor.css
+++ b/editor/dconf-editor.css
@@ -20,6 +20,7 @@
the things could not be solved generically. But don't hesitate to file a bug.
*/
+@import url("base-window.css");
@import url("large-pathbar.css");
/*\
@@ -60,65 +61,6 @@
margin-bottom:0;
}
- .vertical.overlayed-list:not(.delayed-list) > scrolledwindow > viewport > list {
- padding-bottom:0;
- transition:padding-bottom 0.3s,
- font-size 0.3s;
-}
- .vertical.overlayed-list:not(.delayed-list) > scrolledwindow > viewport > list:not(.empty-list) {
- padding-bottom:3rem;
-}
- .vertical.overlayed-list:not(.delayed-list) > .linked-circular {
- margin-bottom:0.3rem;
-}
-
-.horizontal.overlayed-list:dir(ltr):not(.delayed-list) > scrolledwindow > viewport > list > row {
- padding-right:calc(160px+1rem); /* width-request of edit_mode_box + a bit */
-}
-.horizontal.overlayed-list:dir(rtl):not(.delayed-list) > scrolledwindow > viewport > list > row {
- padding-left :calc(160px+1rem); /* width-request of edit_mode_box + a bit */
-}
-.horizontal.overlayed-list:dir(ltr):not(.delayed-list) > .linked-circular {
- margin-right:1.5rem;
-}
-.horizontal.overlayed-list:dir(rtl):not(.delayed-list) > .linked-circular {
- margin-left :1.5rem;
-}
-
- .vertical.overlayed-list:dir(rtl) > .linked-circular > .right-on-ltr,
- .vertical.overlayed-list:dir(ltr) > .linked-circular > .left-on-ltr {
- border-radius:2rem 0 0 2rem;
- -gtk-outline-top-left-radius :2rem;
- -gtk-outline-bottom-left-radius:2rem;
-}
-
- .vertical.overlayed-list:dir(ltr) > .linked-circular > .right-on-ltr,
- .vertical.overlayed-list:dir(rtl) > .linked-circular > .left-on-ltr {
- border-radius:0 2rem 2rem 0;
- -gtk-outline-top-right-radius :2rem;
- -gtk-outline-bottom-right-radius:2rem;
-}
-
-.horizontal.overlayed-list:dir(rtl) > .linked-circular > .right-on-ltr,
-.horizontal.overlayed-list:dir(ltr) > .linked-circular > .left-on-ltr {
- border-radius:1.5rem 1.5rem 0 0;
- -gtk-outline-top-right-radius:1.4rem;
- -gtk-outline-top-left-radius :1.4rem;
-}
-.horizontal.overlayed-list:dir(ltr) > .linked-circular > .right-on-ltr,
-.horizontal.overlayed-list:dir(rtl) > .linked-circular > .left-on-ltr {
- border-radius:0 0 1.5rem 1.5rem;
- -gtk-outline-bottom-right-radius:1.4rem;
- -gtk-outline-bottom-left-radius :1.4rem;
-}
-
-/* hack: fix the double space when the child of the revealer is hidden; 6px is the spacing of the
centerwidget box */
-.centerwidget:dir(ltr) .headerbar-revealer { padding-right:6px; }
-.centerwidget:dir(rtl) .headerbar-revealer { padding-left :6px; }
-
-.centerwidget:dir(ltr) { margin-right:-6px; }
-.centerwidget:dir(rtl) { margin-left :-6px; }
-
/*\
* * pending change list popover
\*/
@@ -138,23 +80,6 @@
.extra-small-window .delayed-list:dir(ltr) > scrolledwindow > viewport > list .diff-bullet { padding-left :
8px; }
.extra-small-window .delayed-list:dir(rtl) > scrolledwindow > viewport > list .diff-bullet { padding-right:
8px; }
-/*\
-* * in-window about
-\*/
-
-.about-list > scrolledwindow > viewport > list > row {
- min-height:1.3rem;
-}
-
-.about-list > scrolledwindow > viewport > list > row > label {
- margin:4px;
-}
-
-.about-list > scrolledwindow > viewport > list > row > button {
- margin-top:2px;
- margin-bottom:2px;
-}
-
/*\
* * lists rows height and icon
\*/
@@ -444,29 +369,10 @@ window:not(.extra-small-window) .small-keys-list-rows .property-value {
padding-left :7px; /* instead of 8px */
}
-/*\
-* * app notification
-\*/
-
-.extra-small-window .app-notification,
- .small-window .app-notification {
- border-radius:0;
-}
-
/*\
* * text formating
\*/
-.small-label {
- font-size:small;
-}
-.bold-label {
- font-weight:bold;
-}
-.italic-label {
- font-style:italic;
-}
-
.greyed-label {
color:@theme_fg_color;
}
@@ -485,10 +391,6 @@ window:not(.extra-small-window) .small-keys-list-rows .property-value {
margin-left:8em;
}
-.big-popover {
- font-size:144%;
-}
-
/*\
* * the end
\*/
diff --git a/editor/dconf-editor.gresource.xml b/editor/dconf-editor.gresource.xml
index 16076a5..fc8ffca 100644
--- a/editor/dconf-editor.gresource.xml
+++ b/editor/dconf-editor.gresource.xml
@@ -4,6 +4,7 @@
<file preprocess="xml-stripblanks">adaptative-window.ui</file>
<file preprocess="xml-stripblanks">base-headerbar.ui</file>
<file preprocess="xml-stripblanks">base-view.ui</file>
+ <file>base-window.css</file>
<file preprocess="xml-stripblanks">base-window.ui</file>
<file preprocess="xml-stripblanks">bookmark.ui</file>
<file preprocess="xml-stripblanks">bookmarks.ui</file>
diff --git a/editor/meson.build b/editor/meson.build
index 4d47f6b..4c89ab9 100644
--- a/editor/meson.build
+++ b/editor/meson.build
@@ -113,7 +113,13 @@ sources = files(
'source-manager.vala'
)
-resource_data = files(
+css_data = files(
+ 'base-window.css',
+ 'dconf-editor.css',
+ 'large-pathbar.css'
+)
+
+ui_data = files(
'adaptative-window.ui',
'base-headerbar.ui',
'base-view.ui',
@@ -123,14 +129,12 @@ resource_data = files(
'bookmark.ui',
'browser-infobar.ui',
'browser-stack.ui',
- 'dconf-editor.css',
'delayed-setting-view.ui',
'filter-list-box-row.ui',
'folder-list-box-row.ui',
'help-overlay.ui',
'key-list-box-row.ui',
'large-pathbar-item.ui',
- 'large-pathbar.css',
'large-pathbar.ui',
'modifications-revealer.ui',
'notifications-revealer.ui',
@@ -146,6 +150,8 @@ resource_data = files(
'short-pathbar.ui'
)
+resource_data = css_data + ui_data
+
sources += gnome.compile_resources(
'resources',
dconf_editor_name + '.gresource.xml',
diff --git a/editor/overlayed-list.vala b/editor/overlayed-list.vala
index f3a48f5..8b0ec51 100644
--- a/editor/overlayed-list.vala
+++ b/editor/overlayed-list.vala
@@ -51,6 +51,8 @@ private abstract class OverlayedList : Overlay, AdaptativeWidget
{
construct
{
+ get_style_context ().add_class ("needs-padding");
+
// TODO sanitize "value"
enter_edit_mode_button.set_detailed_action_name (value + ".set-edit-mode(true)");
leave_edit_mode_button.set_detailed_action_name (value + ".set-edit-mode(false)");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]