Code

Removed redundant refresh button, ui cleanup, added frames, etc. for bug #171376.
authorJon A. Cruz <jon@joncruz.org>
Thu, 6 May 2010 07:20:39 +0000 (00:20 -0700)
committerJon A. Cruz <jon@joncruz.org>
Thu, 6 May 2010 07:20:39 +0000 (00:20 -0700)
src/ui/dialog/icon-preview.cpp
src/ui/dialog/icon-preview.h

index f768df4f34fac024fe35acff2ad931b0370ab856..946eed4ca64cd32066fc0a27e92c4695e0e6ee71 100644 (file)
@@ -87,7 +87,6 @@ IconPreviewPanel::IconPreviewPanel() :
     timer(0),
     pending(false),
     hot(1),
-    refreshButton(0),
     selectionButton(0),
     desktopChangeConn(),
     docReplacedConn(),
@@ -147,7 +146,10 @@ IconPreviewPanel::IconPreviewPanel() :
 
     Gtk::VBox* magBox = new Gtk::VBox();
 
-    magBox->pack_start( magnified );
+    Gtk::Frame *magFrame = Gtk::manage(new Gtk::Frame(_("Magnified:")));
+    magFrame->add( magnified );
+
+    magBox->pack_start( *magFrame, Gtk::PACK_EXPAND_WIDGET );
     magBox->pack_start( magLabel, Gtk::PACK_SHRINK );
 
 
@@ -208,30 +210,21 @@ IconPreviewPanel::IconPreviewPanel() :
 
     iconBox.pack_start(splitter);
     splitter.pack1( *magBox, true, true );
-    splitter.pack2( *verts, false, false );
-
-
-    //## The Refresh button
+    Gtk::Frame *actuals = Gtk::manage(new Gtk::Frame(_("Actual Size:")));
+    actuals->add(*verts);
+    splitter.pack2( *actuals, false, false );
 
 
-    Gtk::HButtonBox* holder = new Gtk::HButtonBox( Gtk::BUTTONBOX_END );
-    _getContents()->pack_end(*holder, false, false);
-
-    selectionButton = new Gtk::ToggleButton(_("Selection")); // , GTK_RESPONSE_APPLY
-    holder->pack_start( *selectionButton, false, false );
+    selectionButton = new Gtk::CheckButton(_("Selection")); // , GTK_RESPONSE_APPLY
+    magBox->pack_start( *selectionButton, Gtk::PACK_SHRINK );
     tips.set_tip((*selectionButton), _("Selection only or whole document"));
     selectionButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::modeToggled) );
 
     gint val = prefs->getBool("/iconpreview/selectionOnly");
     selectionButton->set_active( val != 0 );
 
-    refreshButton = new Gtk::Button(Gtk::Stock::REFRESH); // , GTK_RESPONSE_APPLY
-    holder->pack_end( *refreshButton, false, false );
-    tips.set_tip((*refreshButton), _("Refresh the icons"));
-    refreshButton->signal_clicked().connect( sigc::mem_fun(*this, &IconPreviewPanel::refreshPreview) );
-
 
-    _getContents()->pack_start(iconBox, Gtk::PACK_EXPAND_WIDGET);
+    _getContents()->pack_start(iconBox, Gtk::PACK_SHRINK);
 
     show_all_children();
 
@@ -301,7 +294,6 @@ void IconPreviewPanel::refreshPreview()
         // Do not refresh too quickly
         queueRefresh();
     } else if ( desktop ) {
-
         if ( selectionButton && selectionButton->get_active() )
         {
             Inkscape::Selection * sel = sp_desktop_selection(desktop);
@@ -324,9 +316,7 @@ void IconPreviewPanel::refreshPreview()
                     renderPreview(target);
                 }
             }
-        }
-        else
-        {
+        } else {
             SPObject *target = desktop->currentRoot();
             if ( target ) {
                 renderPreview(target);
index d90c2b173e8b9ca1f1ce930648d1adb6723a44fb..a0f813b94e2cf6583a9b1e6f9287627cfebfac89 100644 (file)
@@ -75,7 +75,6 @@ private:
     Gtk::Image      magnified;
     Gtk::Label      magLabel;
 
-    Gtk::Button           *refreshButton;
     Gtk::ToggleButton     *selectionButton;
 
     guchar** pixMem;
@@ -102,3 +101,14 @@ private:
 
 
 #endif // SEEN_ICON_PREVIEW_H
+
+/*
+  Local Variables:
+  mode:c++
+  c-file-style:"stroustrup"
+  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+  indent-tabs-mode:nil
+  fill-column:99
+  End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :