summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2009-02-27 08:44:52 +0000
committerjoncruz <joncruz@users.sourceforge.net>2009-02-27 08:44:52 +0000
commitb568df726f8fc2454e74e1fbb753041a39d38d01 (patch)
tree64130dd69dda0778b74ef7148a8b6890ae1716a1 /src
parentshare/extensions/inkex.py (class Effect): Remove id_characters instance var, ... (diff)
downloadinkscape-b568df726f8fc2454e74e1fbb753041a39d38d01.tar.gz
inkscape-b568df726f8fc2454e74e1fbb753041a39d38d01.zip
Added work-around for broken themes that fill in with gtk_paint_border, including gtk-qt-engine. Fixes bug #281809.
(bzr r7387)
Diffstat (limited to 'src')
-rw-r--r--src/preferences-skeleton.h2
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp6
-rw-r--r--src/ui/dialog/inkscape-preferences.h1
-rw-r--r--src/widgets/sp-color-scales.cpp4
-rw-r--r--src/widgets/sp-color-slider.cpp29
5 files changed, 34 insertions, 8 deletions
diff --git a/src/preferences-skeleton.h b/src/preferences-skeleton.h
index d84c7cacd..ae39a2272 100644
--- a/src/preferences-skeleton.h
+++ b/src/preferences-skeleton.h
@@ -328,6 +328,8 @@ static char const preferences_skeleton[] =
" empcolor=\"65344\"\n" // 0x0000FF40
" empspacing=\"5\"/>\n"
" </group>\n"
+" <group id=\"workarounds\"\n"
+" colorsontop=\"0\"/>\n"
" </group>\n"
"\n"
" <group id=\"extensions\">"
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index f2cc0b1b8..fe7b1f7c1 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1075,6 +1075,12 @@ void InkscapePreferences::initPageUI()
_page_ui.add_line( false, _("Secondary toolbar icon size"), _misc_small_secondary, "",
_("Set the size for the icons in secondary toolbars to use (requires restart)"), false);
+
+ _ui_colorsliders_top.init( _("Work-around color sliders not drawing."), "/options/workarounds/colorsontop", false);
+ _page_ui.add_line( false, "", _ui_colorsliders_top, "",
+ _("When on, will attempt to work around bugs in certain GTK themes drawing color sliders."), true);
+
+
_misc_recent.init("/options/maxrecentdocuments/value", 0.0, 1000.0, 1.0, 1.0, 1.0, true, false);
Gtk::HBox* recent_hbox = Gtk::manage(new Gtk::HBox());
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 731ccfef8..ac3c96a88 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -187,6 +187,7 @@ protected:
PrefCombo _misc_small_toolbar;
PrefCombo _misc_small_secondary;
PrefCombo _misc_small_tools;
+ PrefCheckButton _ui_colorsliders_top;
PrefSpinButton _misc_recent;
ZoomCorrRulerSlider _ui_zoom_correction;
diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp
index 2cc4915b8..cf06247e7 100644
--- a/src/widgets/sp-color-scales.cpp
+++ b/src/widgets/sp-color-scales.cpp
@@ -45,6 +45,8 @@ static SPColorSelectorClass *parent_class;
#define XPAD 4
#define YPAD 1
+#define noDUMP_CHANGE_INFO 1
+
GType
sp_color_scales_get_type (void)
{
@@ -272,7 +274,7 @@ void ColorScales::_setRangeLimit( gdouble upper )
void ColorScales::_colorChanged()
{
#ifdef DUMP_CHANGE_INFO
- g_message("ColorScales::_colorChanged( this=%p, %f, %f, %f, %f)", this, color.v.c[0], color.v.c[1], color.v.c[2], alpha );
+ g_message("ColorScales::_colorChanged( this=%p, %f, %f, %f, %f)", this, _color.v.c[0], _color.v.c[1], _color.v.c[2], _alpha );
#endif
gfloat tmp[3];
gfloat c[5] = {0.0, 0.0, 0.0, 0.0};
diff --git a/src/widgets/sp-color-slider.cpp b/src/widgets/sp-color-slider.cpp
index b8eb899cc..0e30b1ce6 100644
--- a/src/widgets/sp-color-slider.cpp
+++ b/src/widgets/sp-color-slider.cpp
@@ -15,6 +15,7 @@
#include <gtk/gtkversion.h>
#include <gtk/gtksignal.h>
#include "sp-color-scales.h"
+#include "preferences.h"
#define SLIDER_WIDTH 96
#define SLIDER_HEIGHT 8
@@ -460,6 +461,7 @@ sp_color_slider_paint (SPColorSlider *slider, GdkRectangle *area)
GdkRectangle wpaint, cpaint, apaint;
const guchar *b;
gint w, x, y1, y2;
+ gboolean colorsOnTop = Inkscape::Preferences::get()->getBool("/options/workarounds/colorsontop", false);
widget = GTK_WIDGET (slider);
@@ -482,10 +484,21 @@ sp_color_slider_paint (SPColorSlider *slider, GdkRectangle *area)
aarea.height = carea.height;
/* Actual paintable area */
- if (!gdk_rectangle_intersect (area, &warea, &wpaint)) return;
+ if (!gdk_rectangle_intersect (area, &warea, &wpaint)) {
+ return;
+ }
b = NULL;
+ // Draw shadow
+ if (colorsOnTop) {
+ gtk_paint_shadow( widget->style, widget->window,
+ (GtkStateType)widget->state, GTK_SHADOW_IN,
+ area, widget, "colorslider",
+ 0, 0,
+ warea.width, warea.height);
+ }
+
/* Paintable part of color gradient area */
if (gdk_rectangle_intersect (area, &carea, &cpaint)) {
if (slider->map) {
@@ -556,12 +569,14 @@ sp_color_slider_paint (SPColorSlider *slider, GdkRectangle *area)
}
}
- /* Draw shadow */
- gtk_paint_shadow (widget->style, widget->window,
- (GtkStateType)widget->state, GTK_SHADOW_IN,
- area, widget, "colorslider",
- 0, 0,
- warea.width, warea.height);
+ /* Draw shadow */
+ if (!colorsOnTop) {
+ gtk_paint_shadow( widget->style, widget->window,
+ (GtkStateType)widget->state, GTK_SHADOW_IN,
+ area, widget, "colorslider",
+ 0, 0,
+ warea.width, warea.height);
+ }
if (gdk_rectangle_intersect (area, &aarea, &apaint)) {