From 203af2e7d7deb680610612a6e2b54c1189bae21c Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Tue, 21 Dec 2021 00:31:26 +0100 Subject: [PATCH] ... --- share/ui/#dialog-livepatheffect-add.glade# | 442 ++++++++++++++++++++ share/ui/dialog-livepatheffect-add.glade | 28 +- share/ui/dialog-livepatheffect-effect.glade | 18 +- src/inkscape-window.cpp | 2 +- src/ui/dialog/clonetiler.cpp | 2 +- src/ui/dialog/color-item.cpp | 2 +- src/ui/dialog/dialog-base.cpp | 2 +- src/ui/dialog/dialog-multipaned.cpp | 6 +- src/ui/dialog/dialog-notebook.cpp | 2 +- src/ui/dialog/dialog-window.cpp | 2 +- src/ui/dialog/glyphs.cpp | 2 +- src/ui/dialog/prototype.cpp | 2 +- src/ui/dialog/selectorsdialog.cpp | 6 +- src/ui/dialog/text-edit.cpp | 2 +- src/ui/dialog/xml-tree.cpp | 2 +- src/ui/previewholder.cpp | 4 +- src/ui/toolbar/select-toolbar.cpp | 2 +- src/ui/toolbar/text-toolbar.cpp | 4 +- src/ui/widget/canvas-grid.cpp | 12 +- src/ui/widget/canvas.cpp | 2 +- src/ui/widget/color-notebook.cpp | 2 +- src/ui/widget/color-preview.cpp | 2 +- src/ui/widget/color-wheel-selector.cpp | 2 +- src/ui/widget/filter-effect-chooser.cpp | 2 +- src/ui/widget/gradient-with-stops.cpp | 2 +- src/ui/widget/ink-color-wheel.cpp | 2 +- src/ui/widget/ink-flow-box.cpp | 2 +- src/ui/widget/ink-ruler.cpp | 2 +- src/ui/widget/ink-spinscale.cpp | 6 +- src/ui/widget/layer-selector.cpp | 4 +- src/ui/widget/notebook-page.cpp | 2 +- src/ui/widget/object-composite-settings.cpp | 2 +- src/ui/widget/page-selector.cpp | 2 +- src/ui/widget/paint-selector.cpp | 2 +- src/ui/widget/selected-style.cpp | 6 +- src/ui/widget/spin-button-tool-item.cpp | 2 +- src/ui/widget/spin-scale.cpp | 6 +- src/ui/widget/stroke-style.cpp | 2 +- src/ui/widget/style-swatch.cpp | 2 +- src/ui/widget/unit-tracker.cpp | 2 +- src/widgets/desktop-widget.cpp | 28 +- src/widgets/toolbox.cpp | 4 +- 42 files changed, 536 insertions(+), 94 deletions(-) create mode 100644 share/ui/#dialog-livepatheffect-add.glade# diff --git a/share/ui/#dialog-livepatheffect-add.glade# b/share/ui/#dialog-livepatheffect-add.glade# new file mode 100644 index 0000000000..346229d0ac --- /dev/null +++ b/share/ui/#dialog-livepatheffect-add.glade# @@ -0,0 +1,442 @@ + + + + + + + False + Live Path Effects Selector + True + center-on-parent + True + dialog + True + static + True + + + False + vertical + top + + + False + end + + + + + + + + + False + False + 0 + + + + + True + False + start + vertical + top + + + True + False + True + + + True + False + start + + + 300 + True + True + True + True + True + True + True + edit-find-symbolic + False + False + + + + False + True + 0 + + + + + True + False + + + False + True + 5 + 1 + + + + + True + False + start + center + expand + + + True + True + False + end + center + False + + + + True + False + center + center + 22 + pack-less + 2 + + + + + False + False + 0 + True + + + + + True + True + False + center + center + False + LPESelectorEffectRadioPackLess + + + + True + False + center + center + 22 + pack-more + 2 + + + + + False + False + 1 + True + + + + + True + True + False + start + center + False + LPESelectorEffectRadioPackLess + + + + True + False + center + center + 22 + hamburger-menu + 2 + + + + + False + False + 2 + True + + + + + False + False + 2 + + + + + True + False + + + False + True + 4 + 3 + + + + + + True + False + True + center + center + + + + True + False + center + center + 25 + draw-star-outline + 2 + + + + + + False + True + 4 + + + + + True + False + + + False + True + 5 + 5 + + + + + + True + True + center + center + + + False + False + 7 + + + + + True + False + Show Experimental + + + False + True + 5 + 8 + + + + + + + + True + True + 0 + + + + + False + True + Message + center + end + + + + False + True + 1 + + + + + True + True + never + in + 800 + 10 + True + + + + True + False + + + + True + False + True + start + 1 + 1 + 3 + 30 + + + + + + + False + False + 2 + + + + + False + True + 0 + + + + + + + + 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 ff6d2989b8..b2ef1dfd63 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 bee2189008..f4772e7a59 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 eaba0d4ee9..60c6356d66 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 97690180e0..9dc429c4d8 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 1daadd90ed..ff5de009e1 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 41431a8aeb..e78d47d666 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 2e414f3b31..5625fa5f20 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 f4a85e9abb..b21ce54030 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 c361996537..c7cfed517b 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 511db8f2d7..391c461079 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 97649c882f..5208cd086e 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 50679ca474..be1d8e1039 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 b8d258b113..172001da85 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 25a3a7a64f..5d999af60b 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 12a71c8e89..93abaab5a5 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 f1c03190cf..bfdfbf9783 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 2d5812021f..3732c1eab0 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 a5ebe82c2f..3dc80f161e 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 546bac5ba3..294baeb7d2 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 52983f068f..e50742a843 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 ab81c60eeb..5cecbf03f6 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 d7acdb6370..64d1774475 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 61a9241c95..a219108df4 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 642410ae2b..1c7904a51d 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 447cf4253e..f2f68f02c8 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 86eb8a0a3f..96221f696d 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 899475ca3a..c7b0633695 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 b977d219f7..629861f418 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 0a7861dfdb..335eaa2719 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 876edb686c..e2674813dc 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 195e851f3b..3ac0bc7c16 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 98e9b30e56..9f66345930 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 d05092652e..9d1c7def0d 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 1a4be9dfda..ada242da2f 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 0834bcfc00..9cdfdd6aef 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 21aa525abd..507c96f247 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 e18e0aec9c..d7ba8d6717 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 a79f9d9dab..bbda583cf7 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 7c52b3bd66..c8390c49c0 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 98744322d7..365260748d 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 0433043ee5..d19e6425b1 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); -- GitLab