[gtk-css-engine] [moblesse] Implement separators.
- From: Robert Staudinger <robsta src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-css-engine] [moblesse] Implement separators.
- Date: Wed, 12 Aug 2009 08:06:19 +0000 (UTC)
commit c1be0d14c90d4899f846d7e9be3034286a18878b
Author: Robert Staudinger <robsta gnome org>
Date: Wed Aug 12 10:05:37 2009 +0200
[moblesse] Implement separators.
data/user-agent.css | 57 ++++++++++++++++++++++++++-
src/gce-node.c | 27 +++++++-----
themes/moblesse/gtk-2.0/gtkrc.css | 80 ++++++++++++++++++++++++-------------
3 files changed, 124 insertions(+), 40 deletions(-)
---
diff --git a/data/user-agent.css b/data/user-agent.css
index cfc05a8..68c9041 100644
--- a/data/user-agent.css
+++ b/data/user-agent.css
@@ -130,6 +130,14 @@ GtkHScrollbar > gtk-trough {
border-radius: inherit;
}
+GtkHSeparator > hline {
+ background: none;
+ border-top: inherit;
+ border-right: none;
+ border-bottom: none;
+ border-left: none;
+}
+
/* DEPRECATED, maybe consider later.
GtkListItem > flat-box {
ccss:import("GtkTreeView > flat-box");
@@ -200,12 +208,51 @@ GtkRuler > box {
border-radius: inherit;
}
+/* This applies when using "wide separators". */
GtkSeparator > box {
background: inherit;
border: inherit;
border-radius: inherit;
}
+/* This applies when using "wide separators". */
+GtkSeparatorMenuItem > box {
+ background: inherit;
+ border: inherit;
+ border-radius: inherit;
+}
+
+GtkSeparatorMenuItem > hline {
+ background: none;
+ border-top: inherit;
+ border-right: none;
+ border-bottom: none;
+ border-left: none;
+}
+
+/* This applies when using "wide separators". */
+GtkSeparatorToolItem > box {
+ background: inherit;
+ border: inherit;
+ border-radius: inherit;
+}
+
+GtkSeparatorToolItem > hline {
+ background: none;
+ border-top: inherit;
+ border-right: none;
+ border-bottom: none;
+ border-left: none;
+}
+
+GtkSeparatorToolItem > vline {
+ background: none;
+ border-top: none;
+ border-right: none;
+ border-bottom: none;
+ border-left: inherit;
+}
+
/* FIXME: rtl variant? */
GtkSpinButton > GtkEntry > shadow {
background: inherit;
@@ -232,7 +279,7 @@ GtkTearoffMenuItem > box {
border-radius: inherit;
}
-/* DEPRECATED, maybe consider later.
+/* FIXME: deprecated, maybe consider later.
GtkText > flat-box {
ccss:import("GtkEntry > flat-box");
}
@@ -288,6 +335,14 @@ GtkVScrollbar > gtk-trough {
border-radius: inherit;
}
+GtkVSeparator > vline {
+ background: none;
+ border-top: none;
+ border-right: none;
+ border-bottom: none;
+ border-left: inherit;
+}
+
GtkWindow > flat-box {
background: inherit;
border: inherit;
diff --git a/src/gce-node.c b/src/gce-node.c
index f5c84ef..7c11257 100644
--- a/src/gce-node.c
+++ b/src/gce-node.c
@@ -334,7 +334,10 @@ _to_string (GValue const *value)
}
/* Non-fundamental types can not be handled using `switch'. */
- if (GTK_TYPE_POSITION_TYPE == type) {
+ if (GTK_TYPE_ORIENTATION == type) {
+ enum_value = g_value_get_enum (value);
+ return g_strdup (gce_maps_get_orientation ((GtkPositionType) enum_value));
+ } else if (GTK_TYPE_POSITION_TYPE == type) {
enum_value = g_value_get_enum (value);
return g_strdup (gce_maps_get_position ((GtkPositionType) enum_value));
}
@@ -358,16 +361,18 @@ get_attribute (GceNode const *node,
}
/* Attributes provided in the drawing function take precedence. */
- if (0 == strcmp ("shadow", name)) {
- return g_strdup (node->attribs.shadow);
- } else if (0 == strcmp ("orientation", name)) {
- return g_strdup (node->attribs.orientation);
- } else if (0 == strcmp ("edge", name)) {
- return g_strdup (node->attribs.edge);
- } else if (0 == strcmp ("expander-style", name)) {
- return g_strdup (node->attribs.expander_style);
- } else if (0 == strcmp ("gap", name)) {
- return g_strdup (node->attribs.gap);
+ if (node->flavor == PRIMITIVE) {
+ if (0 == strcmp ("shadow", name)) {
+ return g_strdup (node->attribs.shadow);
+ } else if (0 == strcmp ("orientation", name)) {
+ return g_strdup (node->attribs.orientation);
+ } else if (0 == strcmp ("edge", name)) {
+ return g_strdup (node->attribs.edge);
+ } else if (0 == strcmp ("expander-style", name)) {
+ return g_strdup (node->attribs.expander_style);
+ } else if (0 == strcmp ("gap", name)) {
+ return g_strdup (node->attribs.gap);
+ }
}
/* Now try to find an apropriate style property. */
diff --git a/themes/moblesse/gtk-2.0/gtkrc.css b/themes/moblesse/gtk-2.0/gtkrc.css
index 303f0f2..c0c37da 100644
--- a/themes/moblesse/gtk-2.0/gtkrc.css
+++ b/themes/moblesse/gtk-2.0/gtkrc.css
@@ -4,7 +4,7 @@
*/
* {
- /* FIXME: those need to be exported to gtkrc.
+ /* FIXME: those need to be exported to gtkrc.
xthickness: 1;
ythickness: 1;
*/
@@ -19,7 +19,7 @@
}
*:insensitive {
- background: gtk-mix(0.5, bg_color, grey) ! important;
+ background: gtk-mix(0.5, bg_color, grey) ! important;
border-color: gtk-mix(0.5, fg_color, grey) ! important;
color: gtk-mix(0.5, text_color, grey) ! important;
}
@@ -30,7 +30,7 @@
gtk-cell {
background: gtk-color(base_color);
- border-radius: 0px;
+ border-radius: 0px;
}
gtk-cell:selected {
@@ -53,7 +53,7 @@ gtk-focus {
gtk-handle {
border: 1px solid;
- border-radius: 3px;
+ border-radius: 3px;
}
gtk-header {
@@ -80,9 +80,9 @@ gtk-stepper-up, gtk-stepper-down {
}
gtk-tab {
- background: gtk-shade(1.05, bg_color);
+ background: gtk-shade(1.05, bg_color);
border: 1px solid;
- border-radius: 3px;
+ border-radius: 3px;
}
gtk-trough {
@@ -101,7 +101,7 @@ GtkButton, GtkComboBox, GtkComboBoxEntry, GtkEntry, GtkFrame, GtkNotebook {
GtkButton:prelight, GtkComboBox:prelight {
/* Use shorthand notation, because that's what's inherited. */
background: gtk-lighter(selected_bg_color);
- color: gtk-color(selected_fg_color); /* FIXME seems not to apply. */
+ color: gtk-color(selected_fg_color);
}
GtkButton:active {
@@ -129,12 +129,12 @@ GtkCellView:prelight {
}
GtkComboBoxEntry > GtkButton {
- border-top-left-radius: 0px;
- border-bottom-left-radius: 0px;
+ border-top-left-radius: 0px;
+ border-bottom-left-radius: 0px;
}
GtkComboBoxEntry > GtkEntry {
- border-top-right-radius: 0px;
- border-bottom-right-radius: 0px;
+ border-top-right-radius: 0px;
+ border-bottom-right-radius: 0px;
}
GtkEntry {
@@ -142,8 +142,8 @@ GtkEntry {
}
GtkEntry:selected {
- background-color: gtk-color(selected_bg_color); /* FIXME seems not to apply. */
- color: gtk-color(selected_fg_color); /* FIXME seems not to apply. */
+ background-color: gtk-color(selected_bg_color);
+ color: gtk-color(selected_fg_color);
}
GtkExpander:prelight {
@@ -157,17 +157,17 @@ GtkMenu {
GtkMenuItem:prelight {
background: gtk-lighter(selected_bg_color);
- color: gtk-color(selected_fg_color); /* FIXME seems not to apply. */
+ color: gtk-color(selected_fg_color);
}
GtkNotebook {
- background: gtk-shade(1.05, bg_color);
+ background: gtk-shade(1.05, bg_color);
}
/* FIXME: why can we not just use "GtkProgressBar.bar" here? */
GtkProgressBar > box.bar {
background: gtk-color(selected_bg_color);
- border-radius: 3px;
+ border-radius: 3px;
}
GtkToggleButton[active=true] {
@@ -178,7 +178,7 @@ GtkToggleButton[active=true]:prelight {
}
GtkSpinButton {
- border-radius: 3px; /* FIXME: seems not to apply to the steppers. */
+ border-radius: 3px; /* FIXME: seems not to apply to the steppers. */
}
GtkSpinButton > arrow {
@@ -205,29 +205,53 @@ GtkTreeView > GtkButton {
}
GtkHScrollbar, GtkVScrollbar {
- border-radius: 3px;
+ border-radius: 3px;
}
GtkScrollbar > gtk-handle {
- border-radius: 0px;
+ border-radius: 0px;
}
GtkHScrollbar > gtk-stepper-up {
- border-top-left-radius: 3px;
- border-bottom-left-radius: 3px;
+ border-top-left-radius: 3px;
+ border-bottom-left-radius: 3px;
}
GtkHScrollbar > gtk-stepper-down {
- border-top-right-radius: 3px;
- border-bottom-right-radius: 3px;
+ border-top-right-radius: 3px;
+ border-bottom-right-radius: 3px;
}
GtkVScrollbar > gtk-stepper-up {
- border-top-right-radius: 3px;
- border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ border-top-left-radius: 3px;
}
GtkVScrollbar > gtk-stepper-down {
- border-bottom-right-radius: 3px;
- border-bottom-left-radius: 3px;
+ border-bottom-right-radius: 3px;
+ border-bottom-left-radius: 3px;
+}
+
+GtkHSeparator {
+ border-top: 1px dotted gtk-color(fg_color);
}
+GtkVSeparator {
+ border-left: 1px dotted gtk-color(fg_color);
+}
+
+GtkSeparatorMenuItem {
+ border-top: 1px dotted gtk-color(fg_color);
+}
+
+GtkToolbar[orientation=horizontal] > GtkSeparatorToolItem {
+ border-left: 1px dotted gtk-color(fg_color);
+}
+GtkToolbar[orientation=vertical] > GtkSeparatorToolItem {
+ border-top: 1px dotted gtk-color(fg_color);
+}
+/*
+GtkSeparatorToolItem {
+ border-top: 1px dotted gtk-color(fg_color);
+ border-left: 1px dotted gtk-color(fg_color);
+}
+*/
/*
* Drawing primitives.
@@ -256,6 +280,6 @@ arrow[orientation=right] {
/* FIXME
hline, vline {
- background: gtk-color(fg_color);
+ background: gtk-color(fg_color);
}
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]