diff --git a/share/ui/#dialog-livepatheffect-add.glade# b/share/ui/#dialog-livepatheffect-add.glade#
new file mode 100644
index 0000000000000000000000000000000000000000..346229d0acd3181e455cde9b7f61b4d520797ba6
--- /dev/null
+++ b/share/ui/#dialog-livepatheffect-add.glade#
@@ -0,0 +1,442 @@
+
+
+
+
+
+
+ False
+ True
+ start
+ LPEInfo
+ bottom
+ False
+ False
+
+
+
+ True
+ False
+
+
+ True
+ False
+ vertical
+
+
+ True
+ False
+
+
+ True
+ False
+ start
+ 40
+ align-vertical-baseline
+ 6
+
+
+ False
+ False
+ 0
+
+
+
+
+ True
+ False
+ Name
+ center
+ True
+ 20
+
+
+ False
+ True
+ 1
+
+
+
+
+ False
+ True
+ 0
+
+
+
+
+ True
+ False
+
+
+ False
+ True
+ 1
+
+
+
+
+ True
+ False
+ Description
+ center
+ True
+ 20
+
+
+ False
+ True
+ 2
+
+
+
+
+
+
+
+
+
diff --git a/share/ui/dialog-livepatheffect-add.glade b/share/ui/dialog-livepatheffect-add.glade
index ff6d2989b82e0c27c689f10349bcf0d23bb03c4b..b2ef1dfd63f9dc7819d8f3053daa767a1f3878a2 100644
--- a/share/ui/dialog-livepatheffect-add.glade
+++ b/share/ui/dialog-livepatheffect-add.glade
@@ -3,7 +3,7 @@
- LPEDialogSelector
+
False
Live Path Effects Selector
True
@@ -107,7 +107,7 @@
False
- LPESelectorEffectPackLessImage
+
True
False
center
@@ -136,7 +136,7 @@
LPESelectorEffectRadioPackLess
- LPESelectorEffectPackMoreImage
+
True
False
center
@@ -165,7 +165,7 @@
LPESelectorEffectRadioPackLess
- LPESelectorEffectListImage
+
True
False
center
@@ -204,7 +204,7 @@
- LPESelectorEffectEventFavShow
+
True
False
True
@@ -212,7 +212,7 @@
center
- LPESelectorEffectFavShowImage
+
True
False
center
@@ -246,7 +246,7 @@
- LPEExperimental
+
True
True
center
@@ -311,12 +311,12 @@
True
- LPEViewport
+
True
False
- LPESelectorFlowBox
+
True
False
True
@@ -350,7 +350,7 @@
- LPESelectorEffectInfoPop
+
False
True
start
@@ -360,7 +360,7 @@
False
- LPESelectorEffectInfoEventBox
+
True
False
@@ -374,7 +374,7 @@
False
- LPESelectorEffectInfoIcon
+
True
False
start
@@ -390,7 +390,7 @@
- LPESelectorEffectInfoName
+
True
False
Name
@@ -424,7 +424,7 @@
- LPESelectorEffectInfoDescription
+
True
False
Description
diff --git a/share/ui/dialog-livepatheffect-effect.glade b/share/ui/dialog-livepatheffect-effect.glade
index bee2189008c27c013a5567bbc522f698700b149c..f4772e7a59bb53ea84c364eb3ca4b0e9c0dcf400 100644
--- a/share/ui/dialog-livepatheffect-effect.glade
+++ b/share/ui/dialog-livepatheffect-effect.glade
@@ -3,7 +3,7 @@
- LPESelectorEffect
+
True
True
start
@@ -19,7 +19,7 @@
top
- LPEOverlay
+
True
False
@@ -45,7 +45,7 @@
start
- LPESelectorEffectFavTop
+
True
False
end
@@ -155,7 +155,7 @@
- LPESelectorButtonBox
+
True
False
center
@@ -164,7 +164,7 @@
center
- LPESelectorEffectEventInfo
+
True
False
end
@@ -172,7 +172,7 @@
False
- LPESelectorEffectInfo
+
False
end
start
@@ -195,7 +195,7 @@
- LPESelectorEffectEventFav
+
True
False
center
@@ -203,7 +203,7 @@
False
- LPESelectorEffectFav
+
False
center
start
@@ -226,7 +226,7 @@
- LPESelectorEffectEventApply
+
True
False
start
diff --git a/src/inkscape-window.cpp b/src/inkscape-window.cpp
index eaba0d4ee98069d10a4d5627c691c67e627c88e3..60c6356d66a8a1cee21f5752f699499bf785d0fd 100644
--- a/src/inkscape-window.cpp
+++ b/src/inkscape-window.cpp
@@ -91,7 +91,7 @@ InkscapeWindow::InkscapeWindow(SPDocument* document)
// Main box
_mainbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
- _mainbox->set_name("DesktopMainBox");
+ _mainbox->get_style_context().get()->add_class("DesktopMainBox");
_mainbox->show();
add(*_mainbox);
diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp
index 97690180e0e6758253e29c919f9b3a8debca29b8..9dc429c4d866f9523929885da8ba087c7761d688 100644
--- a/src/ui/dialog/clonetiler.cpp
+++ b/src/ui/dialog/clonetiler.cpp
@@ -1009,7 +1009,7 @@ CloneTiler::CloneTiler()
auto sb = new Inkscape::UI::Widget::SpinButton(a, 1.0, 0);
sb->set_tooltip_text (_("How many rows in the tiling"));
sb->set_width_chars (7);
- sb->set_name("row");
+ sb->get_style_context().get()->add_class("row");
table_attach(table, sb, 0.0f, 1, 2);
_rowscols.push_back(sb);
diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp
index 1daadd90ed39a8dc8c3c23fea4a570a817db5ee3..ff5de009e11916c8337ba6de5e4776a024852a7f 100644
--- a/src/ui/dialog/color-item.cpp
+++ b/src/ui/dialog/color-item.cpp
@@ -459,7 +459,7 @@ Gtk::Widget* ColorItem::_getPreview(UI::Widget::PreviewStyle style,
widget = lbl;
} else {
auto preview = Gtk::manage(new UI::Widget::Preview());
- preview->set_name("ColorItemPreview");
+ preview->get_style_context()->add_class("ColorItemPreview");
_regenPreview(preview);
diff --git a/src/ui/dialog/dialog-base.cpp b/src/ui/dialog/dialog-base.cpp
index 41431a8aebcd8af5d0541dac5b832d691259df15..e78d47d66608feb8296d13a3f2a22e1ee87bff70 100644
--- a/src/ui/dialog/dialog-base.cpp
+++ b/src/ui/dialog/dialog-base.cpp
@@ -71,7 +71,7 @@ DialogBase::DialogBase(gchar const *prefs_path, Glib::ustring dialog_type)
}
}
- set_name(_dialog_type); // Essential for dialog functionality
+ get_style_context().get()->add_class(_dialog_type); // Essential for dialog functionality
property_margin().set_value(1); // Essential for dialog UI
ensure_size();
}
diff --git a/src/ui/dialog/dialog-multipaned.cpp b/src/ui/dialog/dialog-multipaned.cpp
index 2e414f3b31d4bc9883c015021523a7a04155e96a..5625fa5f2073dbe243363f812b12c0f09e0ec063 100644
--- a/src/ui/dialog/dialog-multipaned.cpp
+++ b/src/ui/dialog/dialog-multipaned.cpp
@@ -60,7 +60,7 @@ MyDropZone::MyDropZone(Gtk::Orientation orientation)
, Gtk::Orientable()
, Gtk::EventBox()
{
- set_name("MultipanedDropZone");
+ get_style_context()->add_class("MultipanedDropZone");
set_orientation(orientation);
set_size(DROPZONE_SIZE);
@@ -108,7 +108,7 @@ MyHandle::MyHandle(Gtk::Orientation orientation, int size = get_handle_size())
, _cross_size(0)
, _child(nullptr)
{
- set_name("MultipanedHandle");
+ get_style_context()->add_class("MultipanedHandle");
set_orientation(orientation);
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::POINTER_MOTION_MASK);
@@ -335,7 +335,7 @@ DialogMultipaned::DialogMultipaned(Gtk::Orientation orientation)
, Gtk::Container()
, _empty_widget(nullptr)
{
- set_name("DialogMultipaned");
+ get_style_context()->add_class("DialogMultipaned");
set_orientation(orientation);
set_has_window(false);
set_redraw_on_allocate(false);
diff --git a/src/ui/dialog/dialog-notebook.cpp b/src/ui/dialog/dialog-notebook.cpp
index f4a85e9abb57489ec6295e4e8def7b2562a33b0e..b21ce54030762fb3c9ef66e186a63793bc2a50ef 100644
--- a/src/ui/dialog/dialog-notebook.cpp
+++ b/src/ui/dialog/dialog-notebook.cpp
@@ -42,7 +42,7 @@ DialogNotebook::DialogNotebook(DialogContainer *container)
, _selected_page(nullptr)
, _label_visible(true)
{
- set_name("DialogNotebook");
+ get_style_context().get()->add_class("DialogNotebook");
set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
set_shadow_type(Gtk::SHADOW_NONE);
set_vexpand(true);
diff --git a/src/ui/dialog/dialog-window.cpp b/src/ui/dialog/dialog-window.cpp
index c361996537e042fb7332ce6edbaf74a2909dc9d9..c7cfed517b53d9b092d94aa2bbbae4d8bf507d25 100644
--- a/src/ui/dialog/dialog-window.cpp
+++ b/src/ui/dialog/dialog-window.cpp
@@ -98,7 +98,7 @@ DialogWindow::DialogWindow(Gtk::Widget *page)
// ================ Window ==================
set_title(_title);
- set_name(_title);
+ get_style_context().get()->add_class(_title);
int window_width = INITIAL_WINDOW_WIDTH;
int window_height = INITIAL_WINDOW_HEIGHT;
diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp
index 511db8f2d7b76bb68dd64accfc564b45a80d5c89..391c4610797181d6625d9a31a7daab021bc605f6 100644
--- a/src/ui/dialog/glyphs.cpp
+++ b/src/ui/dialog/glyphs.cpp
@@ -499,7 +499,7 @@ GlyphsPanel::GlyphsPanel()
GlyphColumns *columns = getColumns();
iconView = new Gtk::IconView(static_cast >(store));
- iconView->set_name("UnicodeIconView");
+ iconView->get_style_context().get()->add_class("UnicodeIconView");
iconView->set_markup_column(columns->name);
iconView->set_tooltip_column(2); // Uses Pango markup, must use column number.
iconView->set_margin(0);
diff --git a/src/ui/dialog/prototype.cpp b/src/ui/dialog/prototype.cpp
index 97649c882fcf3c5c397caf58feadbf89f14c542e..5208cd086e45177b8561a9a3c5efecc26d871524 100644
--- a/src/ui/dialog/prototype.cpp
+++ b/src/ui/dialog/prototype.cpp
@@ -31,7 +31,7 @@ Prototype::Prototype()
_label = Gtk::manage(new Gtk::Label(_name));
_label->set_line_wrap();
- _debug_button.set_name("PrototypeDebugButton");
+ _debug_button.get_style_context().get()->add_class("PrototypeDebugButton");
_debug_button.set_hexpand();
_debug_button.signal_clicked().connect(sigc::mem_fun(*this, &Prototype::on_click));
diff --git a/src/ui/dialog/selectorsdialog.cpp b/src/ui/dialog/selectorsdialog.cpp
index 50679ca474f797423699bbf603e663d800399038..be1d8e10391460aa2f18abfa93acde205ed8b163 100644
--- a/src/ui/dialog/selectorsdialog.cpp
+++ b/src/ui/dialog/selectorsdialog.cpp
@@ -297,7 +297,7 @@ void SelectorsDialog::_showWidgets()
bool dir = prefs->getBool("/dialogs/selectors/vertical", true);
_paned.set_orientation(dir ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL);
_selectors_box.set_orientation(Gtk::ORIENTATION_VERTICAL);
- _selectors_box.set_name("SelectorsDialog");
+ _selectors_box.get_style_context().get()->add_class("SelectorsDialog");
_scrolled_window_selectors.add(_treeView);
_scrolled_window_selectors.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
_vadj = _scrolled_window_selectors.get_vadjustment();
@@ -330,7 +330,7 @@ void SelectorsDialog::_showWidgets()
_del.signal_clicked().connect(sigc::mem_fun(*this, &SelectorsDialog::_delSelector));
_del.hide();
_style_dialog = new StyleDialog;
- _style_dialog->set_name("StyleDialog");
+ _style_dialog->get_style_context().get()->add_class("StyleDialog");
_paned.pack1(*_style_dialog, Gtk::SHRINK);
_paned.pack2(_selectors_box, true, true);
_paned.set_wide_handle(true);
@@ -353,7 +353,7 @@ void SelectorsDialog::_showWidgets()
_paned.property_position() = panedpos;
_updating = false;
set_size_request(320, 260);
- set_name("SelectorsAndStyleDialog");
+ get_style_context().get()->add_class("SelectorsAndStyleDialog");
}
void SelectorsDialog::_panedresized(Gtk::Allocation allocation)
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp
index b8d258b113a2f3a9e0a3c2735a98efe37b6d06b3..172001da857ef1b4e9e2f6e414be10d593e67afb 100644
--- a/src/ui/dialog/text-edit.cpp
+++ b/src/ui/dialog/text-edit.cpp
@@ -134,7 +134,7 @@ TextEdit::TextEdit()
fontFeaturesChangedConn = font_features.connectChanged(sigc::mem_fun(*this, &TextEdit::onChange));
notebook->signal_switch_page().connect(sigc::mem_fun(*this, &TextEdit::onFontFeatures));
- font_selector.set_name("TextEdit");
+ font_selector.get_style_context().get()->add_class("TextEdit");
show_all_children();
}
diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp
index 25a3a7a64f4f942de58884b31dab3ea120e8597d..5d999af60b312b2e53a5b0c30d9633db2fabefc7 100644
--- a/src/ui/dialog/xml-tree.cpp
+++ b/src/ui/dialog/xml-tree.cpp
@@ -223,7 +223,7 @@ XmlTree::XmlTree()
raise_node_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_raise_node));
lower_node_button.signal_clicked().connect(sigc::mem_fun(*this, &XmlTree::cmd_lower_node));
- set_name("XMLAndAttributesDialog");
+ get_style_context().get()->add_class("XMLAndAttributesDialog");
set_spacing(0);
set_size_request(320, 260);
show_all();
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index 12a71c8e89c0919595d648493b917f198355a559..93abaab5a5aab33a5e554a10ccb65b34d516cf71 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -45,11 +45,11 @@ PreviewHolder::PreviewHolder() :
{
set_name( "PreviewHolder" );
_scroller = Gtk::manage(new Gtk::ScrolledWindow());
- _scroller->set_name( "PreviewHolderScroller" );
+ _scroller->get_style_context()->add_class( "PreviewHolderScroller" );
_scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
_insides = Gtk::manage(new Gtk::Grid());
- _insides->set_name( "PreviewHolderGrid" );
+ _insides->get_style_context()->add_class( "PreviewHolderGrid" );
_insides->set_column_spacing(8);
_scroller->set_hexpand();
diff --git a/src/ui/toolbar/select-toolbar.cpp b/src/ui/toolbar/select-toolbar.cpp
index f1c03190cfabe4b8a5da73fb2a9a1397c550f9b1..bfdfbf9783a2799b1c60dcb84ea3f784a69a7c20 100644
--- a/src/ui/toolbar/select-toolbar.cpp
+++ b/src/ui/toolbar/select-toolbar.cpp
@@ -165,7 +165,7 @@ SelectToolbar::SelectToolbar(SPDesktop *desktop) :
_lock_btn->set_tooltip_text(_("When locked, change both width and height by the same proportion"));
_lock_btn->set_icon_name(INKSCAPE_ICON("object-unlocked"));
_lock_btn->signal_toggled().connect(sigc::mem_fun(*this, &SelectToolbar::toggle_lock));
- _lock_btn->set_name("lock");
+ _lock_btn->get_style_context()->add_class("lock");
add(*_lock_btn);
// height-value control
diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp
index 2d5812021f1b9c6c6139f6c457f458329b5d0668..3732c1eab0764131c7bbaca7511745ad2216f5d0 100644
--- a/src/ui/toolbar/text-toolbar.cpp
+++ b/src/ui/toolbar/text-toolbar.cpp
@@ -411,7 +411,7 @@ TextToolbar::TextToolbar(SPDesktop *desktop)
_superscript_item->set_label(_("Toggle superscript"));
_superscript_item->set_tooltip_text(_("Toggle superscript"));
_superscript_item->set_icon_name(INKSCAPE_ICON("text_superscript"));
- _superscript_item->set_name("text-superscript");
+ _superscript_item->get_style_context()->add_class("text-superscript");
add(*_superscript_item);
_superscript_item->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &TextToolbar::script_changed), _superscript_item));
_superscript_item->set_active(prefs->getBool("/tools/text/super", false));
@@ -423,7 +423,7 @@ TextToolbar::TextToolbar(SPDesktop *desktop)
_subscript_item->set_label(_("Toggle subscript"));
_subscript_item->set_tooltip_text(_("Toggle subscript"));
_subscript_item->set_icon_name(INKSCAPE_ICON("text_subscript"));
- _subscript_item->set_name("text-subscript");
+ _subscript_item->get_style_context()->add_class("text-subscript");
add(*_subscript_item);
_subscript_item->signal_toggled().connect(sigc::bind(sigc::mem_fun(*this, &TextToolbar::script_changed), _subscript_item));
_subscript_item->set_active(prefs->getBool("/tools/text/sub", false));
diff --git a/src/ui/widget/canvas-grid.cpp b/src/ui/widget/canvas-grid.cpp
index a5ebe82c2fa336835de6e8345b6a729b4fd4d330..3dc80f161e500ae690c2c93feb83f7921da12baf 100644
--- a/src/ui/widget/canvas-grid.cpp
+++ b/src/ui/widget/canvas-grid.cpp
@@ -42,7 +42,7 @@ namespace Widget {
CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
{
_dtw = dtw;
- set_name("CanvasGrid");
+ get_style_context().get()->add_class("CanvasGrid");
// Canvas
_canvas = Gtk::manage(new Inkscape::UI::Widget::Canvas());
@@ -58,7 +58,7 @@ CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
_hadj = Gtk::Adjustment::create(0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0);
_hadj->signal_value_changed().connect(sigc::mem_fun(_dtw, &SPDesktopWidget::on_adjustment_value_changed));
_hscrollbar = Gtk::manage(new Gtk::Scrollbar(_hadj, Gtk::ORIENTATION_HORIZONTAL));
- _hscrollbar->set_name("CanvasScrollbar");
+ _hscrollbar->get_style_context().get()->add_class("CanvasScrollbar");
_hscrollbar->set_hexpand(true);
_hscrollbar->set_no_show_all();
@@ -66,7 +66,7 @@ CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
_vadj = Gtk::Adjustment::create(0.0, -4000.0, 4000.0, 10.0, 100.0, 4.0);
_vadj->signal_value_changed().connect(sigc::mem_fun(_dtw, &SPDesktopWidget::on_adjustment_value_changed));
_vscrollbar = Gtk::manage(new Gtk::Scrollbar(_vadj, Gtk::ORIENTATION_VERTICAL));
- _vscrollbar->set_name("CanvasScrollbar");
+ _vscrollbar->get_style_context().get()->add_class("CanvasScrollbar");
_vscrollbar->set_vexpand(true);
_vscrollbar->set_no_show_all();
@@ -101,7 +101,7 @@ CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
// Guide Lock
auto image1 = Gtk::manage(new Gtk::Image("object-locked", Gtk::ICON_SIZE_MENU));
_guide_lock = Gtk::manage(new Gtk::ToggleButton());
- _guide_lock->set_name("LockGuides");
+ _guide_lock->get_style_context().get()->add_class("LockGuides");
_guide_lock->add(*image1);
_guide_lock->set_no_show_all();
// To be replaced by Gio::Action:
@@ -111,7 +111,7 @@ CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
// CMS Adjust
auto image2 = Gtk::manage(new Gtk::Image("color-management", Gtk::ICON_SIZE_MENU));
_cms_adjust = Gtk::manage(new Gtk::ToggleButton());
- _cms_adjust->set_name("CMS_Adjust");
+ _cms_adjust->get_style_context().get()->add_class("CMS_Adjust");
_cms_adjust->add(*image2);
// Can't access via C++ API, fixed in Gtk4.
gtk_actionable_set_action_name( GTK_ACTIONABLE(_cms_adjust->gobj()), "win.canvas-color-manage");
@@ -121,7 +121,7 @@ CanvasGrid::CanvasGrid(SPDesktopWidget *dtw)
// Sticky Zoom
auto image3 = Gtk::manage(sp_get_icon_image("zoom-original", Gtk::ICON_SIZE_MENU));
_sticky_zoom = Gtk::manage(new Gtk::ToggleButton());
- _sticky_zoom->set_name("StickyZoom");
+ _sticky_zoom->get_style_context().get()->add_class("StickyZoom");
_sticky_zoom->add(*image3);
// To be replaced by Gio::Action:
_sticky_zoom->signal_toggled().connect(sigc::mem_fun(_dtw, &SPDesktopWidget::sticky_zoom_toggled));
diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp
index 546bac5ba3efcd60e4efd0285f44f430d987fc1d..294baeb7d207157deab63cdf329ee32f18511605 100644
--- a/src/ui/widget/canvas.cpp
+++ b/src/ui/widget/canvas.cpp
@@ -99,7 +99,7 @@ namespace Widget {
Canvas::Canvas()
: _size_observer(this, "/options/grabsize/value")
{
- set_name("InkscapeCanvas");
+ get_style_context().get()->add_class("InkscapeCanvas");
// Events
add_events(Gdk::BUTTON_PRESS_MASK |
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index 52983f068fbca0151f4275b3b07cd6143618dabd..e50742a843eada98a0357802c6de1348fd1c246a 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -58,7 +58,7 @@ ColorNotebook::ColorNotebook(SelectedColor &color)
: Gtk::Grid()
, _selected_color(color)
{
- set_name("ColorNotebook");
+ get_style_context().get()->add_class("ColorNotebook");
_available_pages.push_back(new Page(new ColorScalesFactory(SP_COLOR_SCALES_MODE_HSL), "color-selector-hsx"));
_available_pages.push_back(new Page(new ColorScalesFactory(SP_COLOR_SCALES_MODE_HSV), "color-selector-hsx"));
diff --git a/src/ui/widget/color-preview.cpp b/src/ui/widget/color-preview.cpp
index ab81c60eeb5e061e09087754d48677f2bb415601..5cecbf03f6e4b16287bc80a01f942b53556a5419 100644
--- a/src/ui/widget/color-preview.cpp
+++ b/src/ui/widget/color-preview.cpp
@@ -25,7 +25,7 @@ ColorPreview::ColorPreview (guint32 rgba)
{
_rgba = rgba;
set_has_window(false);
- set_name("ColorPreview");
+ get_style_context().get()->add_class("ColorPreview");
}
void
diff --git a/src/ui/widget/color-wheel-selector.cpp b/src/ui/widget/color-wheel-selector.cpp
index d7acdb63709f54d211c4093c17b133a6b81fcb2b..64d17744750beedd6bd3f7cc0dc03958d275e449 100644
--- a/src/ui/widget/color-wheel-selector.cpp
+++ b/src/ui/widget/color-wheel-selector.cpp
@@ -38,7 +38,7 @@ ColorWheelSelector::ColorWheelSelector(SelectedColor &color)
, _wheel(nullptr)
, _slider(nullptr)
{
- set_name("ColorWheelSelector");
+ get_style_context().get()->add_class("ColorWheelSelector");
_initUI();
_color_changed_connection = color.signal_changed.connect(sigc::mem_fun(this, &ColorWheelSelector::_colorChanged));
diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp
index 61a9241c95948bc4ad9f2ca0bd931984b5e21494..a219108df4e2b7ab37848f03c12d7c90b5adc43a 100644
--- a/src/ui/widget/filter-effect-chooser.cpp
+++ b/src/ui/widget/filter-effect-chooser.cpp
@@ -53,7 +53,7 @@ SimpleFilterModifier::SimpleFilterModifier(int flags)
, _notify(true)
, _hb_blend(Gtk::ORIENTATION_HORIZONTAL)
{
- set_name("SimpleFilterModifier");
+ get_style_context().get()->add_class("SimpleFilterModifier");
/* "More options" expander --------
_extras.set_visible();
diff --git a/src/ui/widget/gradient-with-stops.cpp b/src/ui/widget/gradient-with-stops.cpp
index 642410ae2b94e0479444fa7a5cd3c5f846c049a6..1c7904a51d63857c21e55b4baf3d9282c7d04f42 100644
--- a/src/ui/widget/gradient-with-stops.cpp
+++ b/src/ui/widget/gradient-with-stops.cpp
@@ -43,7 +43,7 @@ GradientWithStops::GradientWithStops() :
// default color, it will be updated
_background_color.set_grey(0.5);
// for theming, but not used
- set_name("GradientEdit");
+ get_style_context().get()->add_class("GradientEdit");
// we need some events
add_events(Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::BUTTON_MOTION_MASK |
Gdk::POINTER_MOTION_MASK | Gdk::KEY_PRESS_MASK);
diff --git a/src/ui/widget/ink-color-wheel.cpp b/src/ui/widget/ink-color-wheel.cpp
index 447cf4253e4be3f16cea8a51babddc6120e0d51e..f2f68f02c839ee60f8dc2712571e2651db001632 100644
--- a/src/ui/widget/ink-color-wheel.cpp
+++ b/src/ui/widget/ink-color-wheel.cpp
@@ -110,7 +110,7 @@ ColorWheel::ColorWheel()
, _mode(DragMode::NONE)
, _focus_on_ring(true)
{
- set_name("ColorWheel");
+ get_style_context().get()->add_class("ColorWheel");
add_events(Gdk::BUTTON_PRESS_MASK |
Gdk::BUTTON_RELEASE_MASK |
Gdk::BUTTON_MOTION_MASK |
diff --git a/src/ui/widget/ink-flow-box.cpp b/src/ui/widget/ink-flow-box.cpp
index 86eb8a0a3f1789bbb5207ef3564a3e0456be6e32..96221f696d3e710d93c76227e547a234bb573118 100644
--- a/src/ui/widget/ink-flow-box.cpp
+++ b/src/ui/widget/ink-flow-box.cpp
@@ -23,7 +23,7 @@ namespace Widget {
InkFlowBox::InkFlowBox(const gchar *name)
: Gtk::Box(Gtk::ORIENTATION_VERTICAL)
{
- set_name(name);
+ get_style_context().get()->add_class(name);
this->pack_start(_controller, false, false, 0);
this->pack_start(_flowbox, true, true, 0);
_flowbox.set_activate_on_single_click(true);
diff --git a/src/ui/widget/ink-ruler.cpp b/src/ui/widget/ink-ruler.cpp
index 899475ca3a06b673268352ca7150c4dd197bfbc4..c7b06336950c730cfbb8e5d5e496d4760892c2c9 100644
--- a/src/ui/widget/ink-ruler.cpp
+++ b/src/ui/widget/ink-ruler.cpp
@@ -53,7 +53,7 @@ Ruler::Ruler(Gtk::Orientation orientation)
, _rect()
, _position(0)
{
- set_name("InkRuler");
+ get_style_context().get()->add_class("InkRuler");
set_events(Gdk::POINTER_MOTION_MASK |
Gdk::BUTTON_PRESS_MASK | // For guide creation
diff --git a/src/ui/widget/ink-spinscale.cpp b/src/ui/widget/ink-spinscale.cpp
index b977d219f7002d4be3aa2f449d462260e185de99..629861f4185c8f69c5c96c7abf4354b67fc4080f 100644
--- a/src/ui/widget/ink-spinscale.cpp
+++ b/src/ui/widget/ink-spinscale.cpp
@@ -36,7 +36,7 @@ InkScale::InkScale(Glib::RefPtr adjustment, Gtk::SpinButton* sp
, _drag_start(0)
, _drag_offset(0)
{
- set_name("InkScale");
+ get_style_context().get()->add_class("InkScale");
// std::cout << "GType name: " << G_OBJECT_TYPE_NAME(gobj()) << std::endl;
}
@@ -208,7 +208,7 @@ InkSpinScale::InkSpinScale(double value, double lower,
double upper, double step_increment,
double page_increment, double page_size)
{
- set_name("InkSpinScale");
+ get_style_context().get()->add_class("InkSpinScale");
g_assert (upper - lower > 0);
@@ -234,7 +234,7 @@ InkSpinScale::InkSpinScale(double value, double lower,
InkSpinScale::InkSpinScale(Glib::RefPtr adjustment)
: _adjustment(std::move(adjustment))
{
- set_name("InkSpinScale");
+ get_style_context().get()->add_class("InkSpinScale");
g_assert (_adjustment->get_upper() - _adjustment->get_lower() > 0);
diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp
index 0a7861dfdbcddae9f1361daa46f86de7bdfd9b27..335eaa2719ab10676efcfd54a2723c49c1044a4a 100644
--- a/src/ui/widget/layer-selector.cpp
+++ b/src/ui/widget/layer-selector.cpp
@@ -45,7 +45,7 @@ public:
, _a(nullptr)
, _b(nullptr)
{
- set_name("AlternateIcons");
+ get_style_context().get()->add_class("AlternateIcons");
if (!a.empty()) {
_a = Gtk::manage(sp_get_icon_image(a, size));
_a->set_no_show_all(true);
@@ -81,7 +81,7 @@ LayerSelector::LayerSelector(SPDesktop *desktop)
, _desktop(nullptr)
, _observer(new Inkscape::XML::SignalObserver)
{
- set_name("LayerSelector");
+ get_style_context().get()->add_class("LayerSelector");
_eye_label = Gtk::manage(new AlternateIcons(Gtk::ICON_SIZE_MENU,
INKSCAPE_ICON("object-visible"), INKSCAPE_ICON("object-hidden")));
diff --git a/src/ui/widget/notebook-page.cpp b/src/ui/widget/notebook-page.cpp
index 876edb686c9b924c4da3753f30d6b1718dcd0a40..e2674813dcfcf63ea6ad6c0cd2505a38d0687207 100644
--- a/src/ui/widget/notebook-page.cpp
+++ b/src/ui/widget/notebook-page.cpp
@@ -22,7 +22,7 @@ NotebookPage::NotebookPage(int n_rows, int n_columns, bool expand, bool fill, gu
: Gtk::Box(Gtk::ORIENTATION_VERTICAL)
, _table(Gtk::manage(new Gtk::Grid()))
{
- set_name("NotebookPage");
+ get_style_context().get()->add_class("NotebookPage");
set_border_width(4);
set_spacing(4);
diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp
index 195e851f3bbecb6fe717ee17053102af9915b375..3ac0bc7c167960ed0f10ba19a6de9de50364f2ee 100644
--- a/src/ui/widget/object-composite-settings.cpp
+++ b/src/ui/widget/object-composite-settings.cpp
@@ -45,7 +45,7 @@ ObjectCompositeSettings::ObjectCompositeSettings(Glib::ustring icon_name, char c
_filter_modifier(flags),
_blocked(false)
{
- set_name( "ObjectCompositeSettings");
+ get_style_context().get()->add_class( "ObjectCompositeSettings");
// Filter Effects
pack_start(_filter_modifier, false, false, 2);
diff --git a/src/ui/widget/page-selector.cpp b/src/ui/widget/page-selector.cpp
index 98e9b30e566c8ad1ddcee4adcfc41285a391df99..9f6634593029fc80e34da72512a06f4069472d0d 100644
--- a/src/ui/widget/page-selector.cpp
+++ b/src/ui/widget/page-selector.cpp
@@ -32,7 +32,7 @@ PageSelector::PageSelector(SPDesktop *desktop)
: Gtk::Box(Gtk::ORIENTATION_HORIZONTAL)
, _desktop(desktop)
{
- set_name("PageSelector");
+ get_style_context().get()->add_class("PageSelector");
_prev_button.add(*Gtk::manage(sp_get_icon_image(INKSCAPE_ICON("pan-start"), Gtk::ICON_SIZE_MENU)));
_prev_button.set_relief(Gtk::RELIEF_NONE);
diff --git a/src/ui/widget/paint-selector.cpp b/src/ui/widget/paint-selector.cpp
index d05092652e8308dbede750259bddeac5d73ef235..9d1c7def0d91f5ad33a04fa2ff3f49bab2883230 100644
--- a/src/ui/widget/paint-selector.cpp
+++ b/src/ui/widget/paint-selector.cpp
@@ -151,7 +151,7 @@ PaintSelector::PaintSelector(FillOrStroke kind)
/* Paint style button box */
_style = Gtk::manage(new Gtk::Box());
_style->set_homogeneous(false);
- _style->set_name("PaintSelector");
+ _style->get_style_context().get()->add_class("PaintSelector");
_style->show();
_style->set_border_width(0);
pack_start(*_style, false, false);
diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp
index 1a4be9dfda48d6c6edb70f68bb7eb5bf0b57434e..ada242da2fff298a53b989ffeb52e09e70d74256 100644
--- a/src/ui/widget/selected-style.cpp
+++ b/src/ui/widget/selected-style.cpp
@@ -139,7 +139,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
, _fill_empty_space("")
, _opacity_blocked(false)
{
- set_name("SelectedStyle");
+ get_style_context().get()->add_class("SelectedStyle");
_drop[0] = _drop[1] = nullptr;
_dropEnabled[0] = _dropEnabled[1] = false;
@@ -155,8 +155,8 @@ SelectedStyle::SelectedStyle(bool /*layout*/)
_opacity_label.set_valign(Gtk::ALIGN_CENTER);
_opacity_label.set_margin_top(0);
_opacity_label.set_margin_bottom(0);
- _stroke_width.set_name("monoStrokeWidth");
- _fill_empty_space.set_name("fillEmptySpace");
+ _stroke_width.get_style_context().get()->add_class("monoStrokeWidth");
+ _fill_empty_space.get_style_context().get()->add_class("fillEmptySpace");
_fill_label.set_margin_start(0);
_fill_label.set_margin_end(0);
diff --git a/src/ui/widget/spin-button-tool-item.cpp b/src/ui/widget/spin-button-tool-item.cpp
index 0834bcfc00e5e93af4149eadf28d908e0072353a..9cdfdd6aef40c882082831247b6457dd566cc1d3 100644
--- a/src/ui/widget/spin-button-tool-item.cpp
+++ b/src/ui/widget/spin-button-tool-item.cpp
@@ -371,7 +371,7 @@ SpinButtonToolItem::SpinButtonToolItem(const Glib::ustring name,
{
set_margin_start(3);
set_margin_end(3);
- set_name(_name);
+ get_style_context().get()->add_class(_name);
// Handle popup menu
_btn->signal_popup_menu().connect(sigc::mem_fun(*this, &SpinButtonToolItem::on_popup_menu), false);
diff --git a/src/ui/widget/spin-scale.cpp b/src/ui/widget/spin-scale.cpp
index 21aa525abd33f212dbe32364ffe5861617327ab4..507c96f247170d4193404d4c493127f0ee0b05cc 100644
--- a/src/ui/widget/spin-scale.cpp
+++ b/src/ui/widget/spin-scale.cpp
@@ -29,7 +29,7 @@ SpinScale::SpinScale(const Glib::ustring label, double value,
: AttrWidget(a, value)
, _inkspinscale(value, lower, upper, step_increment, page_increment, 0)
{
- set_name("SpinScale");
+ get_style_context().get()->add_class("SpinScale");
_inkspinscale.set_label (label);
_inkspinscale.set_digits (digits);
@@ -50,7 +50,7 @@ SpinScale::SpinScale(const Glib::ustring label,
: AttrWidget(a, 0.0)
, _inkspinscale(adjustment)
{
- set_name("SpinScale");
+ get_style_context().get()->add_class("SpinScale");
_inkspinscale.set_label (label);
_inkspinscale.set_digits (digits);
@@ -126,7 +126,7 @@ DualSpinScale::DualSpinScale(const Glib::ustring label1, const Glib::ustring lab
//TRANSLATORS: "Link" means to _link_ two sliders together
_link(C_("Sliders", "Link"))
{
- set_name("DualSpinScale");
+ get_style_context().get()->add_class("DualSpinScale");
signal_value_changed().connect(signal_attr_changed().make_slot());
_s1.get_adjustment()->signal_value_changed().connect(_signal_value_changed.make_slot());
diff --git a/src/ui/widget/stroke-style.cpp b/src/ui/widget/stroke-style.cpp
index e18e0aec9c94a0acc4dacb3370f56fb0c6430318..d7ba8d6717ed69d8278a0a2b9ff7e17ec8362287 100644
--- a/src/ui/widget/stroke-style.cpp
+++ b/src/ui/widget/stroke-style.cpp
@@ -144,7 +144,7 @@ StrokeStyle::StrokeStyle() :
endMarkerConn(),
_old_unit(nullptr)
{
- set_name("StrokeSelector");
+ get_style_context().get()->add_class("StrokeSelector");
table = new Gtk::Grid();
table->set_border_width(4);
table->set_row_spacing(4);
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index a79f9d9dab24f88d61567159d1958cab94635524..bbda583cf7a07f5bf58ac37b0246fae8bb3db5ba 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -115,7 +115,7 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_sw_unit(nullptr),
_stroke(Gtk::ORIENTATION_HORIZONTAL)
{
- set_name("StyleSwatch");
+ get_style_context().get()->add_class("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 7c52b3bd66df61c76018ee2423e863439448c4a6..c8390c49c0b4408ba3521bbdf2a2dc8a5c7e290e 100644
--- a/src/ui/widget/unit-tracker.cpp
+++ b/src/ui/widget/unit-tracker.cpp
@@ -190,7 +190,7 @@ UnitTracker::create_tool_item(Glib::ustring const &label,
auto combo = ComboToolItem::create(label, tooltip, "NotUsed", _store);
combo->set_active(_active);
combo->signal_changed().connect(sigc::mem_fun(*this, &UnitTracker::_unitChangedCB));
- combo->set_name("unit-tracker");
+ combo->get_style_context().get()->add_class("unit-tracker");
combo->set_data(Glib::Quark("unit-tracker"), this);
_combo_list.push_back(combo);
return combo;
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 98744322d7d603a8f7d148f314ca51ca35b63a6a..365260748de9fd918f074845519b08b8501d4a49 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -210,12 +210,12 @@ SPDesktopWidget::SPDesktopWidget()
/* Main table */
dtw->_vbox = Gtk::manage(new Gtk::Box(Gtk::ORIENTATION_VERTICAL));
- dtw->_vbox->set_name("DesktopMainTable");
+ dtw->_vbox->get_style_context().get()->add_class("DesktopMainTable");
dtw->add(*dtw->_vbox);
/* Status bar */
dtw->_statusbar = Gtk::manage(new Gtk::Box());
- dtw->_statusbar->set_name("DesktopStatusBar");
+ dtw->_statusbar->get_style_context().get()->add_class("DesktopStatusBar");
dtw->_vbox->pack_end(*dtw->_statusbar, false, true);
/* Swatch Bar */
@@ -225,7 +225,7 @@ SPDesktopWidget::SPDesktopWidget()
/* DesktopHBox (Vertical toolboxes, canvas) */
dtw->_hbox = Gtk::manage(new Gtk::Box());
- dtw->_hbox->set_name("DesktopHbox");
+ dtw->_hbox->get_style_context().get()->add_class("DesktopHbox");
dtw->_vbox->pack_end(*dtw->_hbox, true, true);
dtw->_top_toolbars = Gtk::make_managed();
@@ -346,7 +346,7 @@ SPDesktopWidget::SPDesktopWidget()
// Select Status
dtw->_select_status = Gtk::manage(new Gtk::Label());
- dtw->_select_status->set_name("SelectStatus");
+ dtw->_select_status->get_style_context().get()->add_class("SelectStatus");
dtw->_select_status->set_ellipsize(Pango::ELLIPSIZE_END);
dtw->_select_status->set_line_wrap(true);
dtw->_select_status->set_lines(2);
@@ -380,7 +380,7 @@ SPDesktopWidget::SPDesktopWidget()
auto css_provider_spinbutton = Gtk::CssProvider::create();
css_provider_spinbutton->load_from_data("* { padding-left: 2px; padding-right: 2px; padding-top: 0px; padding-bottom: 0px;}"); // Shouldn't this be in a style sheet? Used also by rotate.
- dtw->_zoom_status->set_name("ZoomStatus");
+ dtw->_zoom_status->get_style_context().get()->add_class("ZoomStatus");
auto context_zoom = dtw->_zoom_status->get_style_context();
context_zoom->add_provider(css_provider_spinbutton, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
@@ -410,18 +410,18 @@ SPDesktopWidget::SPDesktopWidget()
dtw->_rotation_status_populate_popup_connection = dtw->_rotation_status->signal_populate_popup().connect(sigc::mem_fun(dtw, &SPDesktopWidget::rotation_populate_popup));
// Style
- dtw->_rotation_status->set_name("RotationStatus");
+ dtw->_rotation_status->get_style_context().get()->add_class("RotationStatus");
auto context_rotation = dtw->_rotation_status->get_style_context();
context_rotation->add_provider(css_provider_spinbutton, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
// Cursor coordinates
dtw->_coord_status = Gtk::manage(new Gtk::Grid());
- dtw->_coord_status->set_name("CoordinateAndZStatus");
+ dtw->_coord_status->get_style_context().get()->add_class("CoordinateAndZStatus");
dtw->_coord_status->set_row_spacing(0);
dtw->_coord_status->set_column_spacing(10);
dtw->_coord_status->set_margin_end(10);
auto sep = Gtk::manage(new Gtk::Separator(Gtk::ORIENTATION_VERTICAL));
- sep->set_name("CoordinateSeparator");
+ sep->get_style_context().get()->add_class("CoordinateSeparator");
dtw->_coord_status->attach(*sep, 0, 0, 1, 2);
dtw->_coord_status->set_tooltip_text(_("Cursor coordinates"));
@@ -433,17 +433,17 @@ SPDesktopWidget::SPDesktopWidget()
dtw->_coord_status->attach(*label_y, 1, 1, 1, 1);
dtw->_coord_status_x = Gtk::manage(new Gtk::Label());
dtw->_coord_status_y = Gtk::manage(new Gtk::Label());
- dtw->_coord_status_x->set_name("CoordinateStatusX");
- dtw->_coord_status_y->set_name("CoordinateStatusY");
+ dtw->_coord_status_x->get_style_context().get()->add_class("CoordinateStatusX");
+ dtw->_coord_status_y->get_style_context().get()->add_class("CoordinateStatusY");
dtw->_coord_status_x->set_markup(" 0.00 ");
dtw->_coord_status_y->set_markup(" 0.00 ");
// TRANSLATORS: Abbreviation for canvas zoom level
auto label_z = Gtk::manage(new Gtk::Label(C_("canvas", "Z:")));
- label_z->set_name("ZLabel");
+ label_z->get_style_context().get()->add_class("ZLabel");
// TRANSLATORS: Abbreviation for canvas rotation
auto label_r = Gtk::manage(new Gtk::Label(C_("canvas", "R:")));
- label_r->set_name("RLabel");
+ label_r->get_style_context().get()->add_class("RLabel");
dtw->_coord_status_x->set_halign(Gtk::ALIGN_END);
dtw->_coord_status_y->set_halign(Gtk::ALIGN_END);
@@ -1020,7 +1020,7 @@ bool SPDesktopWidget::showInfoDialog( Glib::ustring const &message )
{
Gtk::MessageDialog dialog(*window, message, false, Gtk::MESSAGE_INFO, Gtk::BUTTONS_OK);
dialog.property_destroy_with_parent() = true;
- dialog.set_name("InfoDialog");
+ dialog.get_style_context().get()->add_class("InfoDialog");
dialog.set_title(_("Note:")); // probably want to take this as a parameter.
dialog.run();
}
@@ -1300,7 +1300,7 @@ void SPDesktopWidget::setToolboxPosition(Glib::ustring const& id, GtkPositionTyp
SPDesktopWidget::SPDesktopWidget(SPDocument *document)
: SPDesktopWidget()
{
- set_name("SPDesktopWidget");
+ get_style_context().get()->add_class("SPDesktopWidget");
SPDesktopWidget *dtw = this;
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 0433043ee5a7a2303b1a613c31e25d52462d362e..d19e6425b1d390826bc854df3e6f7012090ed5d8 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -216,7 +216,7 @@ GtkWidget *ToolboxFactory::createAuxToolbox()
GtkWidget *ToolboxFactory::createCommandsToolbox()
{
auto tb = new Gtk::Box();
- tb->set_name("CommandsToolbox");
+ tb->get_style_context().get()->add_class("CommandsToolbox");
tb->set_orientation(Gtk::ORIENTATION_VERTICAL);
tb->set_homogeneous(false);
@@ -264,7 +264,7 @@ public:
GtkWidget *ToolboxFactory::createSnapToolbox()
{
auto tb = new SnapBar();
- tb->set_name("SnapToolbox");
+ tb->get_style_context().get()->add_class("SnapToolbox");
tb->set_orientation(Gtk::ORIENTATION_VERTICAL);
tb->set_homogeneous(false);