Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-06-03 21:18:58 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-06-03 21:18:58 (GMT)
commit73521615d760c4c8afbdf05f7ac372ce3a6c7c62 (patch)
tree0672a4b99d66c9389d22ed5a250a4716f4e0e26a
parentd7e7b5c347240df7abb3ffabb654ba9ab5bd4f32 (diff)
parent6c7fc1372d7b8ee38716516a188dfbdaf1ea5da6 (diff)
Merge branch 'master' of http://git.sipsolutions.net/sugar-artwork
-rw-r--r--gtk/engine/sugar-drawing.c8
-rw-r--r--gtk/engine/sugar-info.c7
-rw-r--r--gtk/theme/gtkrc.em89
3 files changed, 66 insertions, 38 deletions
diff --git a/gtk/engine/sugar-drawing.c b/gtk/engine/sugar-drawing.c
index 08cbda5..99d3646 100644
--- a/gtk/engine/sugar-drawing.c
+++ b/gtk/engine/sugar-drawing.c
@@ -400,7 +400,7 @@ sugar_draw_radio_button (cairo_t *cr, SugarInfo *info)
gdk_cairo_set_source_color (cr, &info->style->text[info->state]);
/* Just used a factor of 2.64 here ... */
- cairo_arc (cr, 0, 0, (radius - line_width) * 9/24.0, 0, 2*G_PI);
+ cairo_arc (cr, 0, 0, (radius - line_width) * 9.0/22.0, 0, 2*G_PI);
cairo_fill (cr);
} else if (info->shadow == GTK_SHADOW_ETCHED_IN) {
/* Sorry, not implemented :-) */
@@ -434,13 +434,13 @@ sugar_draw_check_button (cairo_t *cr, SugarInfo *info)
gdouble width, height;
gdouble thick_line_width = info->rc_style->thick_line_width;
- width = info->pos.width - (line_width + thick_line_width) * 2.0;
- height = info->pos.height - (line_width + thick_line_width) * 2.0;
+ width = info->pos.width - line_width * 2.0 - thick_line_width * 2.3;
+ height = info->pos.height - line_width * 2.0 - thick_line_width * 2.3;
cairo_save (cr);
gdk_cairo_set_source_color (cr, &info->style->text[info->state]);
- cairo_translate (cr, info->pos.x + line_width + thick_line_width, info->pos.y + line_width + thick_line_width);
+ cairo_translate (cr, (double)info->pos.x + line_width + thick_line_width * 1.25, (double)info->pos.y + line_width + thick_line_width*1.15);
cairo_set_line_width (cr, info->rc_style->thick_line_width);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
diff --git a/gtk/engine/sugar-info.c b/gtk/engine/sugar-info.c
index 452aa3a..d37a96e 100644
--- a/gtk/engine/sugar-info.c
+++ b/gtk/engine/sugar-info.c
@@ -18,6 +18,7 @@
*/
#include <gtk/gtk.h>
+#include <math.h>
#include "sugar-info.h"
#define HINT(str) (info->rc_style->hint && g_str_equal (info->rc_style->hint, str))
@@ -97,12 +98,18 @@ sugar_fill_range_info (SugarRangeInfo *range_info, gboolean trough)
info->pos.x += (info->pos.width - width) / 2;
info->pos.width = width;
+
+ info->pos.y += floor(width/2.0);
+ info->pos.height -= 2*floor(width/2.0);
break;
case GTK_ORIENTATION_HORIZONTAL:
width = (info->pos.height - line_width) / 2.0 + line_width;
info->pos.y += (info->pos.height - width) / 2;
info->pos.height = width;
+
+ info->pos.x += floor(width/2.0);
+ info->pos.width -= 2*floor(width/2.0);
break;
}
diff --git a/gtk/theme/gtkrc.em b/gtk/theme/gtkrc.em
index 6c5d100..2e4be8c 100644
--- a/gtk/theme/gtkrc.em
+++ b/gtk/theme/gtkrc.em
@@ -13,15 +13,19 @@ def my_ceil(num):
# These sizes need to be sanity checked ...
if theme == "sugar-xo":
+ xo = True
line_width = 2.25 # 2.25
thick_line_width = 3.5 # 3.5
subcell_size = 15
- bullet_size = 9
+ bullet_size = 9.5
+ font_height = 24
else: # About 50% smaller
+ xo = False
line_width = 1.125
thick_line_width = 1.75
subcell_size = 7
bullet_size = 5
+ font_height = 12
radio_size = my_floor(subcell_size + bullet_size + line_width)
@@ -94,7 +98,7 @@ style "default"
# 9-10 pixel for the XO version, and 4 for the "normal" one
thick_line_width = $thick_line_width
- max_radius = 20.0
+ max_radius = $( xo ? 25 : 15)
}
}
@@ -172,6 +176,12 @@ style "spinbutton"
style "comboboxentry"
{
+ # Copied from the "default" style. Part of the workaround for bug #382646.
+ text[NORMAL] = "#000000"
+ text[ACTIVE] = "#000000"
+ text[SELECTED] = "#000000"
+ text[PRELIGHT] = "#000000"
+
engine "sugar" {
hint = "comboboxentry"
}
@@ -195,19 +205,14 @@ style "toolbutton"
{
color["focus_line"] = "#000000"
- # This makes the normal background of comboboxes invisible
- bg[NORMAL] = "#404040"
+ #bg[NORMAL] = "#404040"
bg[PRELIGHT] = "#000000"
+ bg[ACTIVE] = "#808080"
fg[NORMAL] = "#FFFFFF"
fg[ACTIVE] = "#FFFFFF"
fg[PRELIGHT] = "#ffffff"
- # Work around GTK+ bug #382646
- text[NORMAL] = "#FFFFFF"
- text[ACTIVE] = "#FFFFFF"
- text[PRELIGHT] = "#ffffff"
-
engine "sugar" {
max_radius = 5.0
}
@@ -215,18 +220,24 @@ style "toolbutton"
style "toolbox"
{
+ color["bg_color"] = "#404040"
+
+ fg[NORMAL] = "#FFFFFF"
+ fg[ACTIVE] = "#FFFFFF"
+
+ bg[NORMAL] = @bg_color
+}
+
+style "toolbox-content"
+{
GtkToolbar::shadow-type = GTK_SHADOW_NONE
color["bg_color"] = "#404040"
- bg[ACTIVE] = "#808080"
- bg[NORMAL] = @bg_color
bg[INSENSITIVE] = @bg_color
-
- fg[NORMAL] = "#FFFFFF"
- fg[ACTIVE] = "#FFFFFF"
}
+
style "panel"
{
bg[NORMAL] = "#C0C0C0"
@@ -237,13 +248,12 @@ style "entry"
{
# small inner border and a large x/ythickness for entries
# to reduce the number of hacks needed :-)
- # This size needs to be choosen so the round corner work with the height
- # Something like (height / 2.0 - line_width) / sqrt(2), where height
- # is font height + x/ythickness
- xthickness = 7
- ythickness = 7
+ xthickness = $(thickness*3)
+ ythickness = $(thickness*3)
- GtkEntry::inner-border = { 0, 0, 0, 0 }
+ # This tries to get a height of exactly 45 pixel for the entry.
+ GtkEntry::inner-border = { $(subcell_size - thickness*3), $(subcell_size - thickness*3),
+ $(my_floor((3*subcell_size - font_height - thickness*3*2)/2)), $(my_ceil((3*subcell_size - font_height - thickness*3*2)/2)) }
GtkWidget::focus-line-width = 0
}
@@ -253,6 +263,14 @@ style "button"
fg[NORMAL] = "#ffffff"
}
+style "combobox"
+{
+ # Work around GTK+ bug #382646
+ text[NORMAL] = "#FFFFFF"
+ text[ACTIVE] = "#FFFFFF"
+ text[PRELIGHT] = "#ffffff"
+}
+
style "checkbutton"
{
fg[NORMAL] = "#000000"
@@ -339,20 +357,23 @@ class "GtkHScale" style "hscale"
class "GtkVScale" style "vscale"
class "GtkProgressBar" style "progressbar"
-widget_class "<GtkWindow>.*" style "window-content"
-widget_class "*<GtkComboBoxEntry>*" style "comboboxentry"
-widget_class "*<GtkCombo>*" style "comboboxentry"
-widget_class "*<SugarToolbox>*" style "toolbox"
-widget_class "*<GtkToolButton>*" style "toolbutton"
-widget_class "*<GtkToolItem>*<GtkComboBox>*" style "toolbutton"
-widget_class "*<GtkToolItem>*<GtkButton>*" style "toolbutton"
-widget_class "*<GtkMenu>*" style "menu"
-widget_class "*<GtkMenuItem>*" style "menuitem"
-widget_class "*<GtkSeparatorMenuItem>*" style "menuitem"
+widget_class "<GtkWindow>.*" style "window-content"
+
+widget_class "*<SugarToolbox>*" style "toolbox"
+widget_class "*<SugarToolbox>.GtkNotebook" style "toolbox"
+widget_class "*<SugarToolbox>*" style "toolbox-content"
+widget_class "*<GtkToolButton>*" style "toolbutton"
+
+widget_class "*<GtkMenu>*" style "menu"
+widget_class "*<GtkMenuItem>*" style "menuitem"
+widget_class "*<GtkSeparatorMenuItem>*" style "menuitem"
-widget_class "*<GtkButton>*" style "button"
-widget_class "*<GtkCheckButton>*" style "checkbutton"
+widget_class "*<GtkComboBox>*" style "combobox"
+widget_class "*<GtkComboBoxEntry>*" style "comboboxentry"
+widget_class "*<GtkCombo>*" style "comboboxentry"
+widget_class "*<GtkButton>*" style "button"
+widget_class "*<GtkCheckButton>*" style "checkbutton"
-widget_class "*<SugarPanel>" style "panel"
+widget_class "*<SugarPanel>" style "panel"
-widget_class "*<SugarFrameWindow>*" style "frame"
+widget_class "*<SugarFrameWindow>*" style "frame"