diff options
| author | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-03 09:05:46 +0000 |
|---|---|---|
| committer | Tomasz Boczkowski <penginsbacon@gmail.com> | 2015-05-03 09:05:46 +0000 |
| commit | 5afcb9ce46813689190a622590aee6ab618fb6f4 (patch) | |
| tree | 0ff4b9027a61841eafe0ff71d9f00a3e0b4908cf /src/ui | |
| parent | Introduced fixes after merge proposal review (diff) | |
| download | inkscape-5afcb9ce46813689190a622590aee6ab618fb6f4.tar.gz inkscape-5afcb9ce46813689190a622590aee6ab618fb6f4.zip | |
Removed commented out code from ColorNotebook
(bzr r14059.1.17)
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/widget/color-notebook.cpp | 149 | ||||
| -rw-r--r-- | src/ui/widget/color-notebook.h | 15 |
2 files changed, 0 insertions, 164 deletions
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp index ddffb0246..92b1d7086 100644 --- a/src/ui/widget/color-notebook.cpp +++ b/src/ui/widget/color-notebook.cpp @@ -168,55 +168,6 @@ void ColorNotebook::_initUI() // restore the last active page Inkscape::Preferences *prefs = Inkscape::Preferences::get(); _setCurrentPage(prefs->getInt("/colorselector/page", 0)); - - - /* Commented out: see comment at the bottom of the header file - { - gboolean found = FALSE; - - _popup = gtk_menu_new(); - GtkMenu *menu = GTK_MENU (_popup); - - for (int i = 0; i < _trackerList->len; i++ ) - { - SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (g_ptr_array_index (_trackerList, i)); - if ( entry ) - { - GtkWidget *item = gtk_check_menu_item_new_with_label (_(entry->name)); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), entry->enabledFull); - gtk_widget_show (item); - gtk_menu_shell_append (GTK_MENU_SHELL(menu), item); - - g_signal_connect (G_OBJECT (item), "activate", - G_CALLBACK (sp_color_notebook_menuitem_response), - reinterpret_cast< gpointer > (entry) ); - found = TRUE; - } - } - - GtkWidget *arrow = gtk_arrow_new(GTK_ARROW_RIGHT, GTK_SHADOW_NONE); - gtk_widget_show (arrow); - - _btn = gtk_button_new (); - gtk_widget_show (_btn); - gtk_container_add (GTK_CONTAINER (_btn), arrow); - - GtkWidget *align = gtk_alignment_new (1.0, 0.0, 0.0, 0.0); - gtk_widget_show (align); - gtk_container_add (GTK_CONTAINER (align), _btn); - - // uncomment to reenable the "show/hide modes" menu, - // but first fix it so it remembers its settings in prefs and does not take that much space (entire vertical column!) - gtk_table_attach (GTK_TABLE (table), align, 2, 3, row, row + 1, GTK_FILL, GTK_FILL, XPAD, YPAD); - - g_signal_connect_swapped(G_OBJECT(_btn), "event", G_CALLBACK (sp_color_notebook_menu_handler), G_OBJECT(_csel)); - if ( !found ) - { - gtk_widget_set_sensitive (_btn, FALSE); - } - } - */ - row++; #if GTK_CHECK_VERSION(3,0,0) @@ -420,106 +371,6 @@ void ColorNotebook::_addPage(Page& page) { } } -/* Commented out: see comment at the bottom of the header file - -GtkWidget* ColorNotebook::getPage(GType page_type, guint submode) -{ - gint count = 0; - gint i = 0; - GtkWidget* page = 0; - -// count = gtk_notebook_get_n_pages (_book); - count = 200; - for ( i = 0; i < count && !page; i++ ) - { - page = gtk_notebook_get_nth_page (GTK_NOTEBOOK (_book), i); - if ( page ) - { - SPColorSelector* csel; - guint pagemode; - csel = SP_COLOR_SELECTOR (page); - pagemode = csel->base->getSubmode(); - if ( G_TYPE_FROM_INSTANCE (page) == page_type - && pagemode == submode ) - { - // found it. - break; - } - else - { - page = 0; - } - } - else - { - break; - } - } - return page; -} - -void ColorNotebook::removePage( GType page_type, guint submode ) -{ - GtkWidget *page = 0; - - page = getPage(page_type, submode); - if ( page ) - { - gint where = gtk_notebook_page_num (GTK_NOTEBOOK (_book), page); - if ( where >= 0 ) - { - if ( gtk_notebook_get_current_page (GTK_NOTEBOOK (_book)) == where ) - { -// getColorAlpha(_color, &_alpha); - } - gtk_notebook_remove_page (GTK_NOTEBOOK (_book), where); - } - } -} - - -static gint sp_color_notebook_menu_handler( GtkWidget *widget, GdkEvent *event ) -{ - if (event->type == GDK_BUTTON_PRESS) - { - SPColorSelector* csel = SP_COLOR_SELECTOR(widget); - (dynamic_cast<ColorNotebook*>(csel->base))->menuHandler( event ); - - // Tell calling code that we have handled this event; the buck - // stops here. - return TRUE; - } - - //Tell calling code that we have not handled this event; pass it on. - return FALSE; -} - -gint ColorNotebook::menuHandler( GdkEvent* event ) -{ - GdkEventButton *bevent = (GdkEventButton *) event; - gtk_menu_popup (GTK_MENU( _popup ), NULL, NULL, NULL, NULL, - bevent->button, bevent->time); - return TRUE; -} - -static void sp_color_notebook_menuitem_response (GtkMenuItem *menuitem, gpointer user_data) -{ - gboolean active = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)); - SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (user_data); - if ( entry ) - { - if ( active ) - { - (dynamic_cast<ColorNotebook*>(SP_COLOR_SELECTOR(entry->backPointer)->base))->addPage(entry->type, entry->submode); - } - else - { - (dynamic_cast<ColorNotebook*>(SP_COLOR_SELECTOR(entry->backPointer)->base))->removePage(entry->type, entry->submode); - } - } -} -*/ - /* Local Variables: mode:c++ diff --git a/src/ui/widget/color-notebook.h b/src/ui/widget/color-notebook.h index 9e2aa8ec9..9909aa39c 100644 --- a/src/ui/widget/color-notebook.h +++ b/src/ui/widget/color-notebook.h @@ -82,21 +82,6 @@ private: // By default, disallow copy constructor and assignment operator ColorNotebook( const ColorNotebook& obj ); ColorNotebook& operator=( const ColorNotebook& obj ); - - /* Following methods support the pop-up menu to choose - * active color selectors (notebook tabs). This function - * is not used in Inkscape. If you want to re-enable it you have to - * * port the code to c++ - * * fix it so it remembers its settings in prefs - * * fix it so it does not take that much space (entire vertical column!) - * Current class design supports dynamic addtion and removal of color selectors - * - GtkWidget* addPage( GType page_type, guint submode ); - void removePage( GType page_type, guint submode ); - GtkWidget* getPage( GType page_type, guint submode ); - gint menuHandler( GdkEvent* event ); - - */ }; } |
