From: gustav_b Date: Thu, 20 Sep 2007 22:21:16 +0000 (+0000) Subject: Add functions for showing a specific notebook page in the F&S dialog, X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f38286aa7d5f6b3c0ce20fa9ebf1a4d131a2c85a;p=inkscape.git Add functions for showing a specific notebook page in the F&S dialog, replaced the use of the old sp_object_properties_{fill,stroke} with them. --- diff --git a/src/ui/context-menu.cpp b/src/ui/context-menu.cpp index 20e4f7483..cdd71c410 100644 --- a/src/ui/context-menu.cpp +++ b/src/ui/context-menu.cpp @@ -17,6 +17,7 @@ #include "../xml/repr.h" #include "desktop.h" #include "document.h" +#include "ui/dialog/dialog-manager.h" static void sp_object_type_menu(GType type, SPObject *object, SPDesktop *desktop, GtkMenu *menu); @@ -50,7 +51,6 @@ sp_object_menu(SPObject *object, SPDesktop *desktop, GtkMenu *menu) #include "dialogs/item-properties.h" #include "dialogs/object-attributes.h" -#include "dialogs/object-properties.h" #include "sp-path.h" @@ -319,7 +319,7 @@ sp_shape_fill_settings(GtkMenuItem *menuitem, SPItem *item) sp_desktop_selection(desktop)->set(item); } - sp_object_properties_dialog(); + desktop->_dlg_mgr->showDialog("FillAndStroke"); } static void diff --git a/src/ui/dialog/fill-and-stroke.cpp b/src/ui/dialog/fill-and-stroke.cpp index ad9a9f031..15f39db1c 100644 --- a/src/ui/dialog/fill-and-stroke.cpp +++ b/src/ui/dialog/fill-and-stroke.cpp @@ -137,6 +137,28 @@ FillAndStroke::_layoutPageStrokeStyle() _page_stroke_style.table().attach(*ssl, 0, 1, 0, 1); } +void +FillAndStroke::showPageFill() +{ + present(); + _notebook.set_current_page(0); +} + +void +FillAndStroke::showPageStrokePaint() +{ + present(); + _notebook.set_current_page(1); +} + +void +FillAndStroke::showPageStrokeStyle() +{ + present(); + _notebook.set_current_page(2); +} + + void FillAndStroke::_blendBlurValueChanged() { diff --git a/src/ui/dialog/fill-and-stroke.h b/src/ui/dialog/fill-and-stroke.h index 87d5181db..8c27d6d0a 100644 --- a/src/ui/dialog/fill-and-stroke.h +++ b/src/ui/dialog/fill-and-stroke.h @@ -42,6 +42,10 @@ public: void selectionChanged(Inkscape::Application *inkscape, Inkscape::Selection *selection); + void showPageFill(); + void showPageStrokePaint(); + void showPageStrokeStyle(); + protected: Gtk::Notebook _notebook; diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index aaf5fc35c..d4b0a203a 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -27,7 +27,8 @@ #include "sp-linear-gradient-fns.h" #include "sp-radial-gradient-fns.h" #include "sp-pattern.h" -#include "dialogs/object-properties.h" +#include "ui/dialog/dialog-manager.h" +#include "ui/dialog/fill-and-stroke.h" #include "xml/repr.h" #include "document.h" #include "widgets/widget-sizes.h" @@ -761,18 +762,26 @@ void SelectedStyle::on_fillstroke_swap() { } void SelectedStyle::on_fill_edit() { - sp_object_properties_fill(); + if (Dialog::FillAndStroke *dialog = dynamic_cast( + _desktop->_dlg_mgr->getDialog("FillAndStroke"))) + dialog->showPageFill(); } void SelectedStyle::on_stroke_edit() { - sp_object_properties_stroke(); + if (Dialog::FillAndStroke *dialog = dynamic_cast( + _desktop->_dlg_mgr->getDialog("FillAndStroke"))) + dialog->showPageStrokePaint(); } bool SelectedStyle::on_fill_click(GdkEventButton *event) { if (event->button == 1) { // click, open fill&stroke - sp_object_properties_fill(); + + if (Dialog::FillAndStroke *dialog = dynamic_cast( + _desktop->_dlg_mgr->getDialog("FillAndStroke"))) + dialog->showPageFill(); + } else if (event->button == 3) { // right-click, popup menu _popup[SS_FILL].popup(event->button, event->time); } else if (event->button == 2) { // middle click, toggle none/lastcolor @@ -789,7 +798,9 @@ bool SelectedStyle::on_stroke_click(GdkEventButton *event) { if (event->button == 1) { // click, open fill&stroke - sp_object_properties_stroke(); + if (Dialog::FillAndStroke *dialog = dynamic_cast( + _desktop->_dlg_mgr->getDialog("FillAndStroke"))) + dialog->showPageStrokePaint(); } else if (event->button == 3) { // right-click, popup menu _popup[SS_STROKE].popup(event->button, event->time); } else if (event->button == 2) { // middle click, toggle none/lastcolor @@ -806,7 +817,9 @@ bool SelectedStyle::on_sw_click(GdkEventButton *event) { if (event->button == 1) { // click, open fill&stroke - sp_object_properties_stroke_style (); + if (Dialog::FillAndStroke *dialog = dynamic_cast( + _desktop->_dlg_mgr->getDialog("FillAndStroke"))) + dialog->showPageStrokeStyle(); } else if (event->button == 3) { // right-click, popup menu _popup_sw.popup(event->button, event->time); } else if (event->button == 2) { // middle click, toggle none/lastwidth?