diff options
| author | Jabiertxof <jtx@jtx> | 2017-01-24 14:16:06 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx> | 2017-01-24 14:16:06 +0000 |
| commit | b25ebda10578c5d697db9716e3c2b70950d33e45 (patch) | |
| tree | 4635b8b3f65600cfd54b5465b906ae42165b0674 /src/ui/widget | |
| parent | Fix some bugs (diff) | |
| parent | fix nodes reverting back during editing (diff) | |
| download | inkscape-b25ebda10578c5d697db9716e3c2b70950d33e45.tar.gz inkscape-b25ebda10578c5d697db9716e3c2b70950d33e45.zip | |
fixing to new trunk
(bzr r15142.1.38)
Diffstat (limited to 'src/ui/widget')
| -rw-r--r-- | src/ui/widget/dock-item.cpp | 10 | ||||
| -rw-r--r-- | src/ui/widget/dock.cpp | 2 | ||||
| -rw-r--r-- | src/ui/widget/font-button.cpp | 3 | ||||
| -rw-r--r-- | src/ui/widget/font-button.h | 1 | ||||
| -rw-r--r-- | src/ui/widget/frame.cpp | 30 | ||||
| -rw-r--r-- | src/ui/widget/frame.h | 3 | ||||
| -rw-r--r-- | src/ui/widget/panel.cpp | 20 | ||||
| -rw-r--r-- | src/ui/widget/panel.h | 5 | ||||
| -rw-r--r-- | src/ui/widget/preferences-widget.cpp | 6 | ||||
| -rw-r--r-- | src/ui/widget/registered-widget.h | 2 | ||||
| -rw-r--r-- | src/ui/widget/selected-style.cpp | 51 |
11 files changed, 37 insertions, 96 deletions
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp index 979c09d2f..d124854ae 100644 --- a/src/ui/widget/dock-item.cpp +++ b/src/ui/widget/dock-item.cpp @@ -15,7 +15,6 @@ #include "widgets/icon.h" #include <gtkmm/icontheme.h> -#include <gtkmm/stockitem.h> #include <glibmm/exceptionhandler.h> namespace Inkscape { @@ -47,18 +46,11 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l if (!iconTheme->has_icon(icon_name)) { Inkscape::queueIconPrerender( INKSCAPE_ICON(icon_name.data()), Inkscape::ICON_SIZE_MENU ); } - // Icon might be in the icon theme, or might be a stock item. Check the proper source: if ( iconTheme->has_icon(icon_name) ) { int width = 0; int height = 0; Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height); _icon_pixbuf = iconTheme->load_icon(icon_name, width); - } else { - Gtk::StockItem item; - Gtk::StockID stockId(icon_name); - if ( Gtk::StockItem::lookup(stockId, item) ) { - _icon_pixbuf = _dock.getWidget().render_icon_pixbuf( stockId, Gtk::ICON_SIZE_MENU ); - } } } @@ -423,6 +415,8 @@ void DockItem::_onStateChanged(State /*prev_state*/, State new_state) { _window = getWindow(); + if(_window) + _window->set_type_hint(Gdk::WINDOW_TYPE_HINT_NORMAL); if (new_state == FLOATING_STATE && _window) { _window->signal_hide().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onHideWindow)); diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp index 7744cb695..b2dec401f 100644 --- a/src/ui/widget/dock.cpp +++ b/src/ui/widget/dock.cpp @@ -256,7 +256,7 @@ void Dock::_onLayoutChanged() _paned->get_child1()->set_size_request(-1, -1); _scrolled_window->set_size_request(_default_empty_width); } - getParentPaned()->set_position(INT_MAX); + getParentPaned()->set_position(10000); } else { // unset any forced size requests diff --git a/src/ui/widget/font-button.cpp b/src/ui/widget/font-button.cpp index a472ac6a4..ed57c803a 100644 --- a/src/ui/widget/font-button.cpp +++ b/src/ui/widget/font-button.cpp @@ -8,8 +8,11 @@ #endif #include "font-button.h" + #include <glibmm/i18n.h> +#include <gtkmm/fontbutton.h> + namespace Inkscape { namespace UI { namespace Widget { diff --git a/src/ui/widget/font-button.h b/src/ui/widget/font-button.h index 1f1ad2d01..98c3db440 100644 --- a/src/ui/widget/font-button.h +++ b/src/ui/widget/font-button.h @@ -8,7 +8,6 @@ #ifndef INKSCAPE_UI_WIDGET_FONT_BUTTON_H #define INKSCAPE_UI_WIDGET_FONT_BUTTON_H -#include <gtkmm.h> #include "labelled.h" namespace Inkscape { diff --git a/src/ui/widget/frame.cpp b/src/ui/widget/frame.cpp index 65d10dcc4..6593d9c7c 100644 --- a/src/ui/widget/frame.cpp +++ b/src/ui/widget/frame.cpp @@ -21,26 +21,20 @@ namespace UI { namespace Widget { Frame::Frame(Glib::ustring const &label_text /*= ""*/, gboolean label_bold /*= TRUE*/ ) - : _label(label_text, 1.0, 0.5, TRUE), - _alignment() + : _label(label_text, 1.0, 0.5, TRUE) { set_shadow_type(Gtk::SHADOW_NONE); - //Put an indented GtkAlignment inside the frame. - //Further children should be children of this GtkAlignment: - Gtk::Frame::add(_alignment); - set_padding(4, 0, 8, 0); - set_label_widget(_label); set_label(label_text, label_bold); - - show_all_children(); } void Frame::add(Widget& widget) { - _alignment.add(widget); + Gtk::Frame::add(widget); + set_padding(4, 0, 8, 0); + show_all_children(); } void @@ -56,7 +50,21 @@ Frame::set_label(const Glib::ustring &label_text, gboolean label_bold /*= TRUE*/ void Frame::set_padding (guint padding_top, guint padding_bottom, guint padding_left, guint padding_right) { - _alignment.set_padding(padding_top, padding_bottom, padding_left, padding_right); + auto child = get_child(); + + if(child) + { + child->set_margin_top(padding_top); + child->set_margin_bottom(padding_bottom); + +#if GTK_CHECK_VERSION(3,12,0) + child->set_margin_start(padding_left); + child->set_margin_end(padding_right); +#else + child->set_margin_left(padding_left); + child->set_margin_right(padding_right); +#endif + } } Gtk::Label const * diff --git a/src/ui/widget/frame.h b/src/ui/widget/frame.h index a04666651..24dd716e6 100644 --- a/src/ui/widget/frame.h +++ b/src/ui/widget/frame.h @@ -10,7 +10,6 @@ #ifndef INKSCAPE_UI_WIDGET_FRAME_H #define INKSCAPE_UI_WIDGET_FRAME_H -#include <gtkmm/alignment.h> #include <gtkmm/frame.h> #include <gtkmm/label.h> @@ -55,8 +54,6 @@ public: protected: Gtk::Label _label; - Gtk::Alignment _alignment; - }; } // namespace Widget diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index 6e6e6c527..dff92594b 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -17,7 +17,6 @@ #include <gtkmm/dialog.h> // for Gtk::RESPONSE_* #include <gtkmm/menu.h> -#include <gtkmm/stock.h> #include <gtkmm/checkmenuitem.h> #include <gtkmm/radiomenuitem.h> #include <gtkmm/separatormenuitem.h> @@ -66,7 +65,7 @@ Panel::Panel(Glib::ustring const &label, gchar const *prefs_path, _label(label), _apply_label(apply_label), _verb_num(verb_num), - _temp_arrow(Gtk::ARROW_LEFT, Gtk::SHADOW_ETCHED_OUT), + _temp_arrow(), _menu(0), _action_area(0), _fillable(0) @@ -269,11 +268,9 @@ void Panel::_init() _top_bar.pack_end(_menu_popper, false, false); gint width = 0; gint height = 0; - - if ( gtk_icon_size_lookup( Inkscape::getRegisteredIconSize(Inkscape::ICON_SIZE_DECORATION), &width, &height ) ) { - _temp_arrow.set_size_request(width, height); - } - + gtk_image_set_from_icon_name(_temp_arrow.gobj(), + "pan-start-symbolic", + Inkscape::getRegisteredIconSize(Inkscape::ICON_SIZE_SMALL_TOOLBAR)); _menu_popper.add(_temp_arrow); _menu_popper.signal_button_press_event().connect_notify(sigc::mem_fun(*this, &Panel::_popper)); } @@ -578,14 +575,7 @@ void Panel::_apply() Gtk::Button *Panel::addResponseButton(const Glib::ustring &button_text, int response_id, bool pack_start) { - Gtk::Button *button = new Gtk::Button(button_text); - _addResponseButton(button, response_id, pack_start); - return button; -} - -Gtk::Button *Panel::addResponseButton(const Gtk::StockID &stock_id, int response_id, bool pack_start) -{ - Gtk::Button *button = new Gtk::Button(stock_id); + Gtk::Button *button = new Gtk::Button(button_text, true); _addResponseButton(button, response_id, pack_start); return button; } diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index 370779586..9cbf39de9 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -18,9 +18,9 @@ #endif #include <gtkmm/box.h> -#include <gtkmm/arrow.h> #include <gtkmm/button.h> #include <gtkmm/eventbox.h> +#include <gtkmm/image.h> #include <gtkmm/label.h> #include "enums.h" #include <vector> @@ -101,7 +101,6 @@ public: /* Methods providing a Gtk::Dialog like interface for adding buttons that emit Gtk::RESPONSE * signals on click. */ Gtk::Button* addResponseButton (const Glib::ustring &button_text, int response_id, bool pack_start=false); - Gtk::Button* addResponseButton (const Gtk::StockID &stock_id, int response_id, bool pack_start=false); void setDefaultResponse(int response_id); void setResponseSensitive(int response_id, bool setting); @@ -157,7 +156,7 @@ private: Gtk::VBox _right_bar; Gtk::VBox _contents; Gtk::Label _tab_title; - Gtk::Arrow _temp_arrow; + Gtk::Image _temp_arrow; Gtk::EventBox _menu_popper; Gtk::Button _close_button; Gtk::Menu *_menu; diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp index 1205cd012..b2cebcaa6 100644 --- a/src/ui/widget/preferences-widget.cpp +++ b/src/ui/widget/preferences-widget.cpp @@ -18,7 +18,6 @@ #include <gtkmm/frame.h> #include <gtkmm/alignment.h> #include <gtkmm/scale.h> -#include <gtkmm/stock.h> #include <gtkmm/table.h> #include "preferences.h" @@ -708,8 +707,9 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path, relatedButton = new Gtk::Button(); Gtk::HBox* pixlabel = new Gtk::HBox(false, 3); - Gtk::Image *im = new Gtk::Image(Gtk::StockID(Gtk::Stock::INDEX), - Gtk::ICON_SIZE_BUTTON); + Gtk::Image *im = new Gtk::Image(); + im->set_from_icon_name("applications-graphics", + Gtk::ICON_SIZE_BUTTON); pixlabel->pack_start(*im); Gtk::Label *l = new Gtk::Label(); l->set_markup_with_mnemonic(_("_Browse...")); diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index d410dbfe6..f66d5cbf2 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -135,7 +135,7 @@ private: repr = NULL; doc = NULL; write_undo = false; - event_type = -1; + event_type = 0; //SP_VERB_INVALID } }; diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index ebc6fe919..0370d55db 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -781,56 +781,7 @@ void SelectedStyle::on_stroke_paste() { } void SelectedStyle::on_fillstroke_swap() { - SPCSSAttr *css = sp_repr_css_attr_new (); - - switch (_mode[SS_FILL]) { - case SS_NA: - case SS_MANY: - break; - case SS_NONE: - sp_repr_css_set_property (css, "stroke", "none"); - break; - case SS_UNSET: - sp_repr_css_unset_property (css, "stroke"); - break; - case SS_COLOR: - gchar c[64]; - sp_svg_write_color (c, sizeof(c), _thisselected[SS_FILL]); - sp_repr_css_set_property (css, "stroke", c); - break; - case SS_LGRADIENT: - case SS_RGRADIENT: - case SS_PATTERN: - sp_repr_css_set_property (css, "stroke", _paintserver_id[SS_FILL].c_str()); - break; - } - - switch (_mode[SS_STROKE]) { - case SS_NA: - case SS_MANY: - break; - case SS_NONE: - sp_repr_css_set_property (css, "fill", "none"); - break; - case SS_UNSET: - sp_repr_css_unset_property (css, "fill"); - break; - case SS_COLOR: - gchar c[64]; - sp_svg_write_color (c, sizeof(c), _thisselected[SS_STROKE]); - sp_repr_css_set_property (css, "fill", c); - break; - case SS_LGRADIENT: - case SS_RGRADIENT: - case SS_PATTERN: - sp_repr_css_set_property (css, "fill", _paintserver_id[SS_STROKE].c_str()); - break; - } - - sp_desktop_set_style (_desktop, css); - sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), SP_VERB_DIALOG_FILL_STROKE, - _("Swap fill and stroke")); + _desktop->getSelection()->swapFillStroke(); } void SelectedStyle::on_fill_edit() { |
