summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorRichard White <rwhite8282@gmail.com>2016-05-19 01:17:29 +0000
committerRichard White <rwhite8282@gmail.com>2016-05-19 01:17:29 +0000
commit1fe9c2603c33fddcd9f2688b30e843f91e1a86fa (patch)
tree13289cbe033a46a40eb829437e115b5393e2ca84 /src/ui/widget
parentCorrected frame extension stroke and fill values on 64 bit machine. (diff)
parentGTK3: Another widget named. (diff)
downloadinkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.tar.gz
inkscape-1fe9c2603c33fddcd9f2688b30e843f91e1a86fa.zip
Merge from Inkscape trunk.
(bzr r14668.1.3)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/addtoicon.cpp1
-rw-r--r--src/ui/widget/color-icc-selector.cpp13
-rw-r--r--src/ui/widget/color-notebook.cpp4
-rw-r--r--src/ui/widget/color-preview.cpp1
-rw-r--r--src/ui/widget/color-scales.cpp6
-rw-r--r--src/ui/widget/color-wheel-selector.cpp8
-rw-r--r--src/ui/widget/dock.cpp1
-rw-r--r--src/ui/widget/gimpcolorwheel.c8
-rw-r--r--src/ui/widget/layer-selector.cpp5
-rw-r--r--src/ui/widget/panel.cpp10
-rw-r--r--src/ui/widget/panel.h4
-rw-r--r--src/ui/widget/preferences-widget.cpp4
-rw-r--r--src/ui/widget/selected-style.cpp25
-rw-r--r--src/ui/widget/style-swatch.cpp2
-rw-r--r--src/ui/widget/unit-tracker.cpp10
-rw-r--r--src/ui/widget/unit-tracker.h1
16 files changed, 75 insertions, 28 deletions
diff --git a/src/ui/widget/addtoicon.cpp b/src/ui/widget/addtoicon.cpp
index 823e24a00..10294125d 100644
--- a/src/ui/widget/addtoicon.cpp
+++ b/src/ui/widget/addtoicon.cpp
@@ -48,7 +48,6 @@ AddToIcon::AddToIcon() :
//
// _property_pixbuf_add = Gtk::Widget::
- //property_stock_id() = GTK_STOCK_ADD;
set_pixbuf();
}
diff --git a/src/ui/widget/color-icc-selector.cpp b/src/ui/widget/color-icc-selector.cpp
index 2fe4a0704..ec2e69fb3 100644
--- a/src/ui/widget/color-icc-selector.cpp
+++ b/src/ui/widget/color-icc-selector.cpp
@@ -377,7 +377,6 @@ void ColorICCSelector::init()
(gpointer)_impl);
gtk_widget_set_sensitive(_impl->_fixupBtn, FALSE);
gtk_widget_set_tooltip_text(_impl->_fixupBtn, _("Fix RGB fallback to match icc-color() value."));
- // gtk_misc_set_alignment( GTK_MISC (_impl->_fixupBtn), 1.0, 0.5 );
gtk_widget_show(_impl->_fixupBtn);
attachToGridOrTable(t, _impl->_fixupBtn, 0, row, 1, 1);
@@ -431,7 +430,13 @@ void ColorICCSelector::init()
#endif
_impl->_compUI[i]._label = gtk_label_new_with_mnemonic(labelStr.c_str());
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_impl->_compUI[i]._label, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_impl->_compUI[i]._label), 1.0, 0.5);
+#endif
+
gtk_widget_show(_impl->_compUI[i]._label);
gtk_widget_set_no_show_all(_impl->_compUI[i]._label, TRUE);
@@ -489,7 +494,13 @@ void ColorICCSelector::init()
// Label
_impl->_label = gtk_label_new_with_mnemonic(_("_A:"));
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_impl->_label, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_impl->_label), 1.0, 0.5);
+#endif
+
gtk_widget_show(_impl->_label);
attachToGridOrTable(t, _impl->_label, 0, row, 1, 1);
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index 60abf43bf..6d7ada734 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -210,7 +210,11 @@ void ColorNotebook::_initUI()
/* Create RGBA entry and color preview */
_rgbal = gtk_label_new_with_mnemonic(_("RGBA_:"));
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_rgbal, GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_rgbal), 1.0, 0.5);
+#endif
gtk_box_pack_start(GTK_BOX(rgbabox), _rgbal, TRUE, TRUE, 2);
ColorEntry *rgba_entry = Gtk::manage(new ColorEntry(_selected_color));
diff --git a/src/ui/widget/color-preview.cpp b/src/ui/widget/color-preview.cpp
index 5bcd16528..62c7cca1d 100644
--- a/src/ui/widget/color-preview.cpp
+++ b/src/ui/widget/color-preview.cpp
@@ -23,6 +23,7 @@ ColorPreview::ColorPreview (guint32 rgba)
{
_rgba = rgba;
set_has_window(false);
+ set_name("ColorPreview");
}
void
diff --git a/src/ui/widget/color-scales.cpp b/src/ui/widget/color-scales.cpp
index 170f83887..48a2693bc 100644
--- a/src/ui/widget/color-scales.cpp
+++ b/src/ui/widget/color-scales.cpp
@@ -92,7 +92,13 @@ void ColorScales::_initUI(SPColorScalesMode mode)
for (i = 0; i < static_cast<gint>(G_N_ELEMENTS(_a)); i++) {
/* Label */
_l[i] = gtk_label_new("");
+
+#if GTK_CHECK_VERSION(3,0,0)
+ gtk_widget_set_halign(_l[i], GTK_ALIGN_END);
+#else
gtk_misc_set_alignment(GTK_MISC(_l[i]), 1.0, 0.5);
+#endif
+
gtk_widget_show(_l[i]);
#if GTK_CHECK_VERSION(3, 0, 0)
diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp
index ed3400bb5..22c616325 100644
--- a/src/ui/widget/color-wheel-selector.cpp
+++ b/src/ui/widget/color-wheel-selector.cpp
@@ -245,22 +245,24 @@ void ColorWheelSelector::_wheelChanged(GimpColorWheel *wheel, ColorWheelSelector
guint32 mid = color.toRGBA32(0x7f);
guint32 end = color.toRGBA32(0xff);
+ wheelSelector->_updating = true;
wheelSelector->_slider->setColors(start, mid, end);
-
wheelSelector->_color.preserveICC();
wheelSelector->_color.setHeld(gimp_color_wheel_is_adjusting(wheel));
wheelSelector->_color.setColor(color);
+ wheelSelector->_updating = false;
}
void ColorWheelSelector::_updateDisplay()
{
+ if(_updating) { return; }
+
#ifdef DUMP_CHANGE_INFO
g_message("ColorWheelSelector::_colorChanged( this=%p, %f, %f, %f, %f)", this, _color.color().v.c[0],
_color.color().v.c[1], _color.color().v.c[2], alpha);
#endif
- bool oldval = _updating;
_updating = true;
{
float hsv[3] = { 0, 0, 0 };
@@ -276,7 +278,7 @@ void ColorWheelSelector::_updateDisplay()
ColorScales::setScaled(_alpha_adjustment->gobj(), _color.alpha());
- _updating = oldval;
+ _updating = false;
}
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index c5e14d4f0..fda647182 100644
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
@@ -56,6 +56,7 @@ Dock::Dock(Gtk::Orientation orientation)
#endif
_scrolled_window (Gtk::manage(new Gtk::ScrolledWindow))
{
+ _scrolled_window->set_name("Dock");
#if WITH_GDL_3_6
gtk_orientable_set_orientation(GTK_ORIENTABLE(_gdl_dock_bar),
static_cast<GtkOrientation>(orientation));
diff --git a/src/ui/widget/gimpcolorwheel.c b/src/ui/widget/gimpcolorwheel.c
index f632331d8..d54486505 100644
--- a/src/ui/widget/gimpcolorwheel.c
+++ b/src/ui/widget/gimpcolorwheel.c
@@ -303,7 +303,9 @@ gimp_color_wheel_realize (GtkWidget *widget)
priv->window = gdk_window_new (parent_window, &attr, attr_mask);
gdk_window_set_user_data (priv->window, wheel);
+#if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_style_attach (widget);
+#endif
}
static void
@@ -1246,7 +1248,7 @@ paint_triangle (GimpColorWheel *wheel,
#endif
}
-#if GTK_CHECK_VERSION(3,2,0)
+#if GTK_CHECK_VERSION(3,0,0)
static gboolean
gimp_color_wheel_draw (GtkWidget *widget,
cairo_t *cr)
@@ -1412,6 +1414,10 @@ gimp_color_wheel_set_color (GimpColorWheel *wheel,
priv = wheel->priv;
+ if(h == 0.0 && s == 0.0) {
+ h = priv->h;
+ }
+
priv->h = h;
priv->s = s;
priv->v = v;
diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp
index dc89d233f..1a9ce617f 100644
--- a/src/ui/widget/layer-selector.cpp
+++ b/src/ui/widget/layer-selector.cpp
@@ -32,7 +32,6 @@
#include "util/reverse-list.h"
#include "verbs.h"
#include "widgets/icon.h"
-#include "widgets/shrink-wrap-button.h"
#include "xml/node-event-vector.h"
#include "widgets/gradient-vector.h"
@@ -46,6 +45,7 @@ public:
AlternateIcons(Inkscape::IconSize size, gchar const *a, gchar const *b)
: _a(NULL), _b(NULL)
{
+ set_name("AlternateIcons");
if (a) {
_a = Gtk::manage(sp_icon_get_icon(a, size));
_a->set_no_show_all(true);
@@ -95,6 +95,7 @@ private:
LayerSelector::LayerSelector(SPDesktop *desktop)
: _desktop(NULL), _layer(NULL)
{
+ set_name("LayerSelector");
AlternateIcons *label;
label = Gtk::manage(new AlternateIcons(Inkscape::ICON_SIZE_DECORATION,
@@ -114,7 +115,6 @@ LayerSelector::LayerSelector(SPDesktop *desktop)
);
_visibility_toggle.set_relief(Gtk::RELIEF_NONE);
- shrink_wrap_button(_visibility_toggle);
_visibility_toggle.set_tooltip_text(_("Toggle current layer visibility"));
pack_start(_visibility_toggle, Gtk::PACK_EXPAND_PADDING);
@@ -135,7 +135,6 @@ LayerSelector::LayerSelector(SPDesktop *desktop)
);
_lock_toggle.set_relief(Gtk::RELIEF_NONE);
- shrink_wrap_button(_lock_toggle);
_lock_toggle.set_tooltip_text(_("Lock or unlock current layer"));
pack_start(_lock_toggle, Gtk::PACK_EXPAND_PADDING);
diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp
index 8a1e98a63..ab13577d7 100644
--- a/src/ui/widget/panel.cpp
+++ b/src/ui/widget/panel.cpp
@@ -73,6 +73,10 @@ Panel::Panel(Glib::ustring const &label, gchar const *prefs_path,
_action_area(0),
_fillable(0)
{
+ set_name( "InkscapePanel" );
+#if WITH_GTKMM_3_0
+ set_orientation( Gtk::ORIENTATION_VERTICAL );
+#endif
_init();
}
@@ -92,7 +96,6 @@ void Panel::_popper(GdkEventButton* event)
void Panel::_init()
{
- Glib::ustring tmp("<");
_anchor = SP_ANCHOR_CENTER;
guint panel_size = 0, panel_mode = 0, panel_ratio = 100, panel_border = 0;
@@ -282,7 +285,10 @@ void Panel::_init()
pack_start(_top_bar, false, false);
Gtk::HBox* boxy = Gtk::manage(new Gtk::HBox());
-
+ boxy->set_name( "PanelBoxY" );
+ _contents.set_name( "PanelContents" );
+ _right_bar.set_name( "PanelRightBar" );
+ _top_bar.set_name( "PanelTopBar" );
boxy->pack_start(_contents, true, true);
boxy->pack_start(_right_bar, false, true);
diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h
index a90060e17..7b2836fe8 100644
--- a/src/ui/widget/panel.h
+++ b/src/ui/widget/panel.h
@@ -64,7 +64,11 @@ namespace Widget {
* @see UI::Dialog::DesktopTracker to handle desktop change, selection change and selected object modifications.
* @see UI::Dialog::DialogManager manages the dialogs within inkscape.
*/
+#if WITH_GTKMM_3_0
+class Panel : public Gtk::Box {
+#else
class Panel : public Gtk::VBox {
+#endif
public:
static void prep();
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index e906762e3..d56506d62 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -468,12 +468,8 @@ ZoomCorrRuler::on_draw(const Cairo::RefPtr<Cairo::Context>& cr) {
Glib::ustring abbr = prefs->getString("/options/zoomcorrection/unit");
if (abbr == "cm") {
draw_marks(cr, 0.1, 10);
- } else if (abbr == "ft") {
- draw_marks(cr, 1/12.0, 12);
} else if (abbr == "in") {
draw_marks(cr, 0.25, 4);
- } else if (abbr == "m") {
- draw_marks(cr, 1/10.0, 10);
} else if (abbr == "mm") {
draw_marks(cr, 10, 10);
} else if (abbr == "pc") {
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 9e283fc64..f7fd63f51 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -155,6 +155,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
_unit_mis(NULL),
_sw_unit(NULL)
{
+ set_name("SelectedStyle");
_drop[0] = _drop[1] = 0;
_dropEnabled[0] = _dropEnabled[1] = false;
@@ -363,19 +364,6 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
_popup_sw.show_all();
}
- _fill_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_fill_click));
- _stroke_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_stroke_click));
- _opacity_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_click));
- _stroke_width_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click));
- _stroke_width_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click));
-
-
- _opacity_sb.signal_populate_popup().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_menu));
- _opacity_sb.signal_value_changed().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_changed));
- // Connect to key-press to ensure focus is consistent with other spin buttons when using the keys vs mouse-click
- g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "key-press-event", G_CALLBACK (spinbutton_keypress), _opacity_sb.gobj());
- g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "focus-in-event", G_CALLBACK (spinbutton_focus_in), _opacity_sb.gobj());
-
_fill_place.add(_na[SS_FILL]);
_fill_place.set_tooltip_text(__na[SS_FILL]);
@@ -452,6 +440,17 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
"drag_data_received",
G_CALLBACK(dragDataReceived),
_drop[SS_FILL]);
+
+ _fill_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_fill_click));
+ _stroke_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_stroke_click));
+ _opacity_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_click));
+ _stroke_width_place.signal_button_press_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click));
+ _stroke_width_place.signal_button_release_event().connect(sigc::mem_fun(*this, &SelectedStyle::on_sw_click));
+ _opacity_sb.signal_populate_popup().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_menu));
+ _opacity_sb.signal_value_changed().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_changed));
+ // Connect to key-press to ensure focus is consistent with other spin buttons when using the keys vs mouse-click
+ g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "key-press-event", G_CALLBACK (spinbutton_keypress), _opacity_sb.gobj());
+ g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "focus-in-event", G_CALLBACK (spinbutton_focus_in), _opacity_sb.gobj());
}
SelectedStyle::~SelectedStyle()
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index fa8543c46..188be705d 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -124,6 +124,8 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
#endif
_sw_unit(NULL)
{
+ set_name("StyleSwatch");
+
_label[SS_FILL].set_markup(_("Fill:"));
_label[SS_STROKE].set_markup(_("Stroke:"));
diff --git a/src/ui/widget/unit-tracker.cpp b/src/ui/widget/unit-tracker.cpp
index c6318db25..a1501c229 100644
--- a/src/ui/widget/unit-tracker.cpp
+++ b/src/ui/widget/unit-tracker.cpp
@@ -12,6 +12,7 @@
* Released under GNU GPL, read the file 'COPYING' for more information
*/
+#include "style-internal.h"
#include "unit-tracker.h"
#include "widgets/ege-select-one-action.h"
@@ -121,6 +122,15 @@ void UnitTracker::addUnit(Inkscape::Util::Unit const *u)
gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1);
}
+void UnitTracker::prependUnit(Inkscape::Util::Unit const *u)
+{
+ GtkTreeIter iter;
+ gtk_list_store_prepend(_store, &iter);
+ gtk_list_store_set(_store, &iter, COLUMN_STRING, u ? u->abbr.c_str() : "NULL", -1);
+ /* Re-shuffle our default selection here (_active gets out of sync) */
+ setActiveUnit(_activeUnit);
+}
+
void UnitTracker::setFullVal(GtkAdjustment *adj, gdouble val)
{
_priorValues[adj] = val;
diff --git a/src/ui/widget/unit-tracker.h b/src/ui/widget/unit-tracker.h
index 06245930e..8fa9ff304 100644
--- a/src/ui/widget/unit-tracker.h
+++ b/src/ui/widget/unit-tracker.h
@@ -43,6 +43,7 @@ public:
void addUnit(Inkscape::Util::Unit const *u);
void addAdjustment(GtkAdjustment *adj);
+ void prependUnit(Inkscape::Util::Unit const *u);
void setFullVal(GtkAdjustment *adj, gdouble val);
GtkAction *createAction(gchar const *name, gchar const *label, gchar const *tooltip);