summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2019-06-20 13:20:52 +0000
committerMarc Jeanmougin <marc@jeanmougin.fr>2019-06-20 13:20:52 +0000
commitaf32f53a859d8bc0dc5c07d644a8158f8c950cdc (patch)
tree0ed9599288b92de7441e624630659a9faee4ab3b /src/ui
parentMerge branch 'copypasta' of gitlab.com:nathanal/inkscape (diff)
parentRemove deprecated usage of custom Gtk::IconSize (diff)
downloadinkscape-af32f53a859d8bc0dc5c07d644a8158f8c950cdc.tar.gz
inkscape-af32f53a859d8bc0dc5c07d644a8158f8c950cdc.zip
Merge branch 'gtk3-deprecated' of gitlab.com:Qantas94Heavy/inkscape
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/desktop/menubar.cpp2
-rw-r--r--src/ui/dialog/filter-effects-dialog.cpp8
-rw-r--r--src/ui/dialog/livepatheffect-add.cpp15
-rw-r--r--src/ui/dialog/symbols.cpp37
-rw-r--r--src/ui/toolbar/gradient-toolbar.cpp1
-rw-r--r--src/ui/widget/page-sizer.cpp7
-rw-r--r--src/ui/widget/page-sizer.h1
-rw-r--r--src/ui/widget/spin-button-tool-item.cpp17
-rw-r--r--src/ui/widget/spin-button-tool-item.h4
9 files changed, 39 insertions, 53 deletions
diff --git a/src/ui/desktop/menubar.cpp b/src/ui/desktop/menubar.cpp
index 7300e8c3b..04e97a933 100644
--- a/src/ui/desktop/menubar.cpp
+++ b/src/ui/desktop/menubar.cpp
@@ -124,7 +124,7 @@ build_menu_item_from_verb(SPAction* action,
}
Gtk::AccelLabel* label = Gtk::manage(new Gtk::AccelLabel(action->name, true));
- label->set_alignment(0.0, 0.5);
+ label->set_xalign(0.0);
label->set_accel_widget(*menuitem);
sp_shortcut_add_accelerator((GtkWidget*)menuitem->gobj(), sp_shortcut_get_primary(action->verb));
diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp
index 48398e716..4521cada7 100644
--- a/src/ui/dialog/filter-effects-dialog.cpp
+++ b/src/ui/dialog/filter-effects-dialog.cpp
@@ -983,8 +983,9 @@ private:
Gtk::HBox *hb = Gtk::manage(new Gtk::HBox);
hb->set_spacing(12);
- if(label != "") {
- Gtk::Label *lbl = Gtk::manage(new Gtk::Label(label, 0.0, 0.5));
+ if (label != "") {
+ Gtk::Label *lbl = Gtk::manage(new Gtk::Label(label));
+ lbl->set_xalign(0.0);
hb->pack_start(*lbl, Gtk::PACK_SHRINK);
_size_group->add_widget(*lbl);
}
@@ -1156,10 +1157,11 @@ public:
: AttrWidget(SP_ATTR_INVALID),
_dialog(d),
_settings(d, _box, sigc::mem_fun(_dialog, &FilterEffectsDialog::set_child_attr_direct), LIGHT_ENDSOURCE),
- _light_label(_("Light Source:"), 0.0, 0.5),
+ _light_label(_("Light Source:")),
_light_source(LightSourceConverter),
_locked(false)
{
+ _light_label.set_xalign(0.0);
_settings._size_group->add_widget(_light_label);
_light_box.pack_start(_light_label, Gtk::PACK_SHRINK);
_light_box.pack_start(_light_source, Gtk::PACK_EXPAND_WIDGET);
diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp
index a31f71a8c..39b6f7d52 100644
--- a/src/ui/dialog/livepatheffect-add.cpp
+++ b/src/ui/dialog/livepatheffect-add.cpp
@@ -141,7 +141,7 @@ LivePathEffectAdd::LivePathEffectAdd()
LPEExperimentalToggle->set_active(active);
Gtk::Image *LPEIcon;
builder_effect->get_widget("LPEIcon", LPEIcon);
- LPEIcon->set_from_icon_name(converter.get_icon(data->id), Gtk::BuiltinIconSize(Gtk::ICON_SIZE_DIALOG));
+ LPEIcon->set_from_icon_name(converter.get_icon(data->id), Gtk::IconSize(Gtk::ICON_SIZE_DIALOG));
Gtk::EventBox *LPESelectorEffectEventInfo;
builder_effect->get_widget("LPESelectorEffectEventInfo", LPESelectorEffectEventInfo);
LPESelectorEffectEventInfo->signal_enter_notify_event().connect(sigc::bind<Glib::RefPtr<Gtk::Builder>>(
@@ -150,7 +150,7 @@ LivePathEffectAdd::LivePathEffectAdd()
builder_effect->get_widget("LPESelectorEffectEventFav", LPESelectorEffectEventFav);
if (sp_has_fav(LPEName->get_text())) {
Gtk::Image *fav = dynamic_cast<Gtk::Image *>(LPESelectorEffectEventFav->get_child());
- fav->set_from_icon_name("draw-star", Gtk::IconSize(25));
+ fav->set_from_icon_name("draw-star", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR));
}
Gtk::EventBox *LPESelectorEffectEventFavTop;
builder_effect->get_widget("LPESelectorEffectEventFavTop", LPESelectorEffectEventFavTop);
@@ -271,7 +271,7 @@ bool LivePathEffectAdd::pop_description(GdkEventCrossing *evt, Glib::RefPtr<Gtk:
Gtk::Image *LPESelectorEffectInfoIcon;
_builder->get_widget("LPESelectorEffectInfoIcon", LPESelectorEffectInfoIcon);
- LPESelectorEffectInfoIcon->set_from_icon_name(LPEIcon->get_icon_name(), Gtk::IconSize(60));
+ LPESelectorEffectInfoIcon->set_from_icon_name(LPEIcon->get_icon_name(), Gtk::IconSize(Gtk::ICON_SIZE_DIALOG));
Gtk::Label *LPESelectorEffectInfoName;
_builder->get_widget("LPESelectorEffectInfoName", LPESelectorEffectInfoName);
@@ -306,7 +306,7 @@ bool LivePathEffectAdd::fav_toggler(GdkEventButton *evt, Glib::RefPtr<Gtk::Build
if (sp_has_fav(LPEName->get_text())) {
LPESelectorEffectEventFavTop->set_visible(false);
LPESelectorEffectEventFavTop->hide();
- LPESelectorEffectFav->set_from_icon_name("draw-star-outline", Gtk::IconSize(25));
+ LPESelectorEffectFav->set_from_icon_name("draw-star-outline", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR));
sp_remove_fav(LPEName->get_text());
LPESelectorEffect->get_parent()->get_style_context()->remove_class("lpefav");
LPESelectorEffect->get_parent()->get_style_context()->add_class("lpenormal");
@@ -317,7 +317,7 @@ bool LivePathEffectAdd::fav_toggler(GdkEventButton *evt, Glib::RefPtr<Gtk::Build
} else {
LPESelectorEffectEventFavTop->set_visible(true);
LPESelectorEffectEventFavTop->show();
- LPESelectorEffectFav->set_from_icon_name("draw-star", Gtk::IconSize(25));
+ LPESelectorEffectFav->set_from_icon_name("draw-star", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR));
sp_add_fav(LPEName->get_text());
LPESelectorEffect->get_parent()->get_style_context()->add_class("lpefav");
LPESelectorEffect->get_parent()->get_style_context()->remove_class("lpenormal");
@@ -333,14 +333,15 @@ bool LivePathEffectAdd::show_fav_toggler(GdkEventButton *evt)
Gtk::Image *favimage = dynamic_cast<Gtk::Image *>(_LPESelectorEffectEventFavShow->get_child());
if (favimage) {
if (_showfavs) {
- favimage->set_from_icon_name("draw-star", Gtk::IconSize(favimage->get_pixel_size()));
+ favimage->set_from_icon_name("draw-star", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR));
} else {
- favimage->set_from_icon_name("draw-star-outline", Gtk::IconSize(favimage->get_pixel_size()));
+ favimage->set_from_icon_name("draw-star-outline", Gtk::IconSize(Gtk::ICON_SIZE_SMALL_TOOLBAR));
}
}
reload_effect_list();
return true;
}
+
bool LivePathEffectAdd::apply(GdkEventButton *evt, Glib::RefPtr<Gtk::Builder> builder_effect,
const LivePathEffect::EnumEffectData<LivePathEffect::EffectType> *to_add)
{
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 9eaec21dc..a269ae094 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -201,37 +201,38 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
overlay->add(* scroller);
overlay->get_style_context()->add_class("brightstyle");
scroller->set_size_request(100, 250);
- table->attach(*Gtk::manage(overlay),0,row,2,1);
+ table->attach(*Gtk::manage(overlay), 0, row, 2, 1);
/*************************Overlays******************************/
overlay_opacity = new Gtk::Image();
- overlay_opacity->set_halign(Gtk::ALIGN_START );
- overlay_opacity->set_valign(Gtk::ALIGN_START );
- //No results
- iconsize = Gtk::IconSize().from_name(Glib::ustring("ICON_SIZE_DIALOG_EXTRA"));
- if (!iconsize) {
- iconsize = Gtk::IconSize().register_new(Glib::ustring("ICON_SIZE_DIALOG_EXTRA"), 110, 110);
- }
- overlay_icon = sp_get_icon_image("searching", iconsize);
+ overlay_opacity->set_halign(Gtk::ALIGN_START);
+ overlay_opacity->set_valign(Gtk::ALIGN_START);
+
+ // No results
+ overlay_icon = sp_get_icon_image("searching", Gtk::ICON_SIZE_DIALOG);
+ overlay_icon->set_pixel_size(110);
overlay_icon->get_style_context()->add_class("iconsymbolic");
- overlay_icon->set_halign(Gtk::ALIGN_CENTER );
- overlay_icon->set_valign(Gtk::ALIGN_START );
+ overlay_icon->set_halign(Gtk::ALIGN_CENTER);
+ overlay_icon->set_valign(Gtk::ALIGN_START);
overlay_icon->set_margin_top(45);
+
overlay_title = new Gtk::Label();
overlay_title->set_halign(Gtk::ALIGN_CENTER );
overlay_title->set_valign(Gtk::ALIGN_START );
overlay_title->set_justify(Gtk::JUSTIFY_CENTER);
overlay_title->set_margin_top(155);
+
overlay_desc = new Gtk::Label();
- overlay_desc->set_halign(Gtk::ALIGN_CENTER );
- overlay_desc->set_valign(Gtk::ALIGN_START );
+ overlay_desc->set_halign(Gtk::ALIGN_CENTER);
+ overlay_desc->set_valign(Gtk::ALIGN_START);
overlay_desc->set_margin_top(180);
overlay_desc->set_justify(Gtk::JUSTIFY_CENTER);
- overlay->add_overlay(* overlay_opacity);
- overlay->add_overlay(* overlay_icon);
- overlay->add_overlay(* overlay_title);
- overlay->add_overlay(* overlay_desc);
-
+
+ overlay->add_overlay(*overlay_opacity);
+ overlay->add_overlay(*overlay_icon);
+ overlay->add_overlay(*overlay_title);
+ overlay->add_overlay(*overlay_desc);
+
previous_height = 0;
++row;
diff --git a/src/ui/toolbar/gradient-toolbar.cpp b/src/ui/toolbar/gradient-toolbar.cpp
index afd613c83..b38736cf7 100644
--- a/src/ui/toolbar/gradient-toolbar.cpp
+++ b/src/ui/toolbar/gradient-toolbar.cpp
@@ -749,7 +749,6 @@ GradientToolbar::stop_set_offset()
_offset_adj->set_value(stop->offset);
_offset_item->set_sensitive( !isEndStop );
- _offset_adj->changed();
}
/**
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index a193f84da..bd7409a0c 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -191,13 +191,6 @@ PageSizer::PageSizer(Registry & _wr)
_customDimTable.attach(_fitPageMarginExpander, 0, 1, 3, 1);
- _dimTabOrderList.clear();
- _dimTabOrderList.push_back(&_dimensionWidth);
- _dimTabOrderList.push_back(&_dimensionHeight);
- _dimTabOrderList.push_back(&_dimensionUnits);
- _dimTabOrderList.push_back(&_fitPageMarginExpander);
- _customDimTable.set_focus_chain(_dimTabOrderList);
-
//## Set up fit page expander
_fitPageMarginExpander.set_use_underline();
_fitPageMarginExpander.set_label(_("Resi_ze page to content..."));
diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h
index 54ffb9c73..b399835b7 100644
--- a/src/ui/widget/page-sizer.h
+++ b/src/ui/widget/page-sizer.h
@@ -224,7 +224,6 @@ protected:
RegisteredUnitMenu _dimensionUnits;
RegisteredScalarUnit _dimensionWidth;
RegisteredScalarUnit _dimensionHeight;
- std::vector<Widget*> _dimTabOrderList;
//### Fit Page options
Gtk::Expander _fitPageMarginExpander;
diff --git a/src/ui/widget/spin-button-tool-item.cpp b/src/ui/widget/spin-button-tool-item.cpp
index c21989723..b283939e9 100644
--- a/src/ui/widget/spin-button-tool-item.cpp
+++ b/src/ui/widget/spin-button-tool-item.cpp
@@ -418,9 +418,9 @@ SpinButtonToolItem::set_icon(const Glib::ustring& icon_name)
}
bool
-SpinButtonToolItem::on_btn_button_press_event(GdkEventButton *button_event)
+SpinButtonToolItem::on_btn_button_press_event(const GdkEventButton *button_event)
{
- if (gdk_event_triggers_context_menu((GdkEvent *)button_event) &&
+ if (gdk_event_triggers_context_menu(reinterpret_cast<const GdkEvent *>(button_event)) &&
button_event->type == GDK_BUTTON_PRESS) {
do_popup_menu(button_event);
return true;
@@ -430,21 +430,12 @@ SpinButtonToolItem::on_btn_button_press_event(GdkEventButton *button_event)
}
void
-SpinButtonToolItem::do_popup_menu(GdkEventButton *button_event)
+SpinButtonToolItem::do_popup_menu(const GdkEventButton *button_event)
{
auto menu = create_numeric_menu();
menu->attach_to_widget(*_btn);
menu->show_all();
-
- int button = 0;
- int time = gtk_get_current_event_time();
-
- if (button_event) {
- button = button_event->button;
- time = button_event->time;
- }
-
- menu->popup(button, time);
+ menu->popup_at_pointer(reinterpret_cast<const GdkEvent *>(button_event));
}
/**
diff --git a/src/ui/widget/spin-button-tool-item.h b/src/ui/widget/spin-button-tool-item.h
index 4386d4799..c073f561c 100644
--- a/src/ui/widget/spin-button-tool-item.h
+++ b/src/ui/widget/spin-button-tool-item.h
@@ -44,9 +44,9 @@ private:
bool on_btn_focus_in_event(GdkEventFocus *focus_event);
bool on_btn_focus_out_event(GdkEventFocus *focus_event);
bool on_btn_key_press_event(GdkEventKey *key_event);
- bool on_btn_button_press_event(GdkEventButton *button_event);
+ bool on_btn_button_press_event(const GdkEventButton *button_event);
bool on_popup_menu();
- void do_popup_menu(GdkEventButton *button_event);
+ void do_popup_menu(const GdkEventButton *button_event);
void defocus();
bool process_tab(int direction);