summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-12-14 22:07:33 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-12-14 22:07:33 +0000
commitefe4e17c2e6664a761d3da24f113b8c57e05cfc7 (patch)
treef7dc68a3660dedabe2a7c9ed9635dbed683ff43b
parentMerge branch 'master' into powerpencilII (diff)
parentMinor header cleanup. Add a few class names. (diff)
downloadinkscape-efe4e17c2e6664a761d3da24f113b8c57e05cfc7.tar.gz
inkscape-efe4e17c2e6664a761d3da24f113b8c57e05cfc7.zip
Merge branch 'master' into powerpencilII
-rw-r--r--share/ui/style.css5
-rw-r--r--src/ui/dialog/filter-effects-dialog.h2
-rw-r--r--src/ui/dialog/objects.h2
-rw-r--r--src/ui/dialog/tags.h1
-rw-r--r--src/ui/previewholder.cpp317
-rw-r--r--src/ui/previewholder.h14
-rw-r--r--src/ui/widget/filter-effect-chooser.cpp2
-rw-r--r--src/ui/widget/spin-scale.h7
-rw-r--r--src/ui/widget/spin-slider.cpp1
9 files changed, 173 insertions, 178 deletions
diff --git a/share/ui/style.css b/share/ui/style.css
index 92b3c412c..7c3487673 100644
--- a/share/ui/style.css
+++ b/share/ui/style.css
@@ -93,3 +93,8 @@ combobox window.popup scrolledwindow treeview separator {
#CMS_Adjust {
padding: 0;
}
+
+/* Keep pallete scrollbar from generating warnings. */
+#PreviewHolderScrolledWindow .vertical slider {
+ min-height: 15px;
+}
diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h
index 1c9f75e6f..73d23bd37 100644
--- a/src/ui/dialog/filter-effects-dialog.h
+++ b/src/ui/dialog/filter-effects-dialog.h
@@ -20,7 +20,7 @@
#include "ui/widget/panel.h"
#include "sp-filter.h"
#include "ui/widget/combo-enums.h"
-#include "ui/widget/spin-slider.h"
+
#include "ui/widget/spin-scale.h"
#include "xml/helper-observer.h"
#include "ui/dialog/desktop-tracker.h"
diff --git a/src/ui/dialog/objects.h b/src/ui/dialog/objects.h
index 8ad1b15ef..73a0f0643 100644
--- a/src/ui/dialog/objects.h
+++ b/src/ui/dialog/objects.h
@@ -20,10 +20,10 @@
#include <gtkmm/treeview.h>
#include <gtkmm/treestore.h>
#include <gtkmm/scrolledwindow.h>
+#include <gtkmm/scale.h>
#include <gtkmm/dialog.h>
#include "ui/widget/spinbutton.h"
#include "ui/widget/panel.h"
-#include "ui/widget/object-composite-settings.h"
#include "desktop-tracker.h"
#include "ui/widget/style-subject.h"
#include "selection.h"
diff --git a/src/ui/dialog/tags.h b/src/ui/dialog/tags.h
index bdda22dd4..cc791b927 100644
--- a/src/ui/dialog/tags.h
+++ b/src/ui/dialog/tags.h
@@ -19,7 +19,6 @@
#include <gtkmm/dialog.h>
#include "ui/widget/spinbutton.h"
#include "ui/widget/panel.h"
-#include "ui/widget/object-composite-settings.h"
#include "desktop-tracker.h"
#include "ui/widget/style-subject.h"
#include "selection.h"
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index e294bd408..faf98d725 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -30,7 +30,7 @@ namespace UI {
PreviewHolder::PreviewHolder() :
- VBox(),
+ Box(),
PreviewFillable(),
_scroller(0),
_insides(0),
@@ -45,25 +45,18 @@ PreviewHolder::PreviewHolder() :
{
set_name( "PreviewHolder" );
_scroller = Gtk::manage(new Gtk::ScrolledWindow());
- _scroller->set_name( "PreviewHolderScroller" );
- ((Gtk::ScrolledWindow *)_scroller)->set_policy(Gtk::POLICY_AUTOMATIC,
- Gtk::POLICY_AUTOMATIC);
+ _scroller->set_name( "PreviewHolderScrolledWindow" );
+ _scroller->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
_insides = Gtk::manage(new Gtk::Grid());
_insides->set_name( "PreviewHolderGrid" );
_insides->set_column_spacing(8);
-
- // Add a container with the scroller and a spacer
- Gtk::Grid* spaceHolder = Gtk::manage(new Gtk::Grid());
- spaceHolder->set_name( "PreviewHolderSpaceHolder" );
_scroller->set_hexpand();
_scroller->set_vexpand();
_scroller->add( *_insides );
-
- spaceHolder->attach( *_scroller, 0, 0, 1, 1);
- pack_start(*spaceHolder, Gtk::PACK_EXPAND_WIDGET);
+ pack_start(*_scroller, Gtk::PACK_EXPAND_WIDGET);
}
PreviewHolder::~PreviewHolder()
@@ -74,7 +67,7 @@ PreviewHolder::~PreviewHolder()
bool PreviewHolder::on_scroll_event(GdkEventScroll *event)
{
// Scroll horizontally by page on mouse wheel
- auto adj = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hadjustment();
+ auto adj = _scroller->get_hadjustment();
if (!adj) {
return FALSE;
@@ -95,7 +88,7 @@ void PreviewHolder::clear()
_prefCols = 0;
// Kludge to restore scrollbars
if ( !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ _scroller->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
}
rebuildUI();
}
@@ -116,11 +109,11 @@ void PreviewHolder::addPreview( Previewable* preview )
case VIEW_TYPE_LIST:
{
Gtk::Widget* label = Gtk::manage(preview->getPreview(PREVIEW_STYLE_BLURB, VIEW_TYPE_LIST, _baseSize, _ratio, _border));
- Gtk::Widget* thing = Gtk::manage(preview->getPreview(PREVIEW_STYLE_PREVIEW, VIEW_TYPE_LIST, _baseSize, _ratio, _border));
+ Gtk::Widget* item = Gtk::manage(preview->getPreview(PREVIEW_STYLE_PREVIEW, VIEW_TYPE_LIST, _baseSize, _ratio, _border));
- thing->set_hexpand();
- thing->set_vexpand();
- _insides->attach(*thing, 0, i, 1, 1);
+ item->set_hexpand();
+ item->set_vexpand();
+ _insides->attach(*item, 0, i, 1, 1);
label->set_hexpand();
label->set_valign(Gtk::ALIGN_CENTER);
@@ -130,34 +123,41 @@ void PreviewHolder::addPreview( Previewable* preview )
break;
case VIEW_TYPE_GRID:
{
- Gtk::Widget* thing = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, VIEW_TYPE_GRID, _baseSize, _ratio, _border));
+ Gtk::Widget* item = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, VIEW_TYPE_GRID, _baseSize, _ratio, _border));
- int width = 1;
- int height = 1;
- calcGridSize( thing, items.size(), width, height );
-
- // Column and row for the new widget
- int col = i % width;
- int row = i / width;
+ int ncols = 1;
+ int nrows = 1;
+ int col = 0;
+ int row = 0;
+ // To get size
auto kids = _insides->get_children();
int childCount = (int)kids.size();
- // g_message(" %3d resize from %d to %d (r:%d, c:%d) with %d children", i, oldWidth, width, row, col, childCount );
+ if (childCount > 0 ) {
+
+ // Need already shown widget
+ calcGridSize( kids[0], items.size()+1, ncols, nrows );
+
+ // Column and row for the new widget
+ col = i % ncols;
+ row = i / ncols;
+
+ }
// Loop through the existing widgets and move them to new location
for ( int j = 1; j < childCount; j++ ) {
auto target = kids[childCount - (j + 1)];
- int col2 = j % width;
- int row2 = j / width;
+ int col2 = j % ncols;
+ int row2 = j / ncols;
_insides->remove( *target );
target->set_hexpand();
target->set_vexpand();
_insides->attach( *target, col2, row2, 1, 1);
}
- thing->set_hexpand();
- thing->set_vexpand();
- _insides->attach(*thing, col, row, 1, 1);
+ item->set_hexpand();
+ item->set_vexpand();
+ _insides->attach(*item, col, row, 1, 1);
}
}
@@ -186,52 +186,52 @@ void PreviewHolder::setStyle( ::PreviewSize size, ViewType view, guint ratio, ::
_border = border;
// Kludge to restore scrollbars
if ( !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ _scroller->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
}
rebuildUI();
}
}
-void PreviewHolder::setOrientation(SPAnchorType how)
+void PreviewHolder::setOrientation(SPAnchorType anchor)
{
- if ( _anchor != how )
+ if ( _anchor != anchor )
{
- _anchor = how;
+ _anchor = anchor;
switch ( _anchor )
{
case SP_ANCHOR_NORTH:
case SP_ANCHOR_SOUTH:
{
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, _wrap ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER );
+ _scroller->set_policy( Gtk::POLICY_AUTOMATIC, _wrap ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER );
}
break;
case SP_ANCHOR_EAST:
case SP_ANCHOR_WEST:
{
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC );
+ _scroller->set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC );
}
break;
default:
{
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
+ _scroller->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
}
}
rebuildUI();
}
}
-void PreviewHolder::setWrap( bool b )
+void PreviewHolder::setWrap( bool wrap )
{
- if ( b != _wrap ) {
- _wrap = b;
+ if (_wrap != wrap) {
+ _wrap = wrap;
switch ( _anchor )
{
case SP_ANCHOR_NORTH:
case SP_ANCHOR_SOUTH:
{
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, _wrap ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER );
+ _scroller->set_policy( Gtk::POLICY_AUTOMATIC, _wrap ? Gtk::POLICY_AUTOMATIC : Gtk::POLICY_NEVER );
}
break;
default:
@@ -249,169 +249,160 @@ void PreviewHolder::setColumnPref( int cols )
_prefCols = cols;
}
-void PreviewHolder::on_size_allocate( Gtk::Allocation& allocation )
+void PreviewHolder::get_preferred_height_vfunc(int& minimum_height, int& natural_height) const
{
-// g_message( "on_size_allocate(%d, %d) (%d, %d)", allocation.get_x(), allocation.get_y(), allocation.get_width(), allocation.get_height() );
-// g_message(" anchor:%d", _anchor);
- Gtk::VBox::on_size_allocate( allocation );
-
-/* if ( _insides && !_wrap && (_view != VIEW_TYPE_LIST) && (_anchor == SP_ANCHOR_NORTH || _anchor == SP_ANCHOR_SOUTH) ) {
- Gtk::Requisition req;
- Gtk::Requisition req_natural;
- _insides->get_preferred_size(req, req_natural);
- gint delta = allocation.get_width() - req.width;
-
- if ( (delta > 4) && req.height < allocation.get_height() ) {
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_NEVER );
- } else {
- dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
- }
- }*/
-}
+ // If we have a child (swatch), use that to get it's height.
+ auto children = _insides->get_children();
+ int minimum_height_child = 0;
+ int natural_height_child = 0;
+ if (children.size() > 0) {
+ children[0]->get_preferred_height(minimum_height_child, natural_height_child);
+ }
+
+ if (_wrap) {
+ // If wrapped, make height three times child height (seems reasonable).
+ minimum_height = 3 * minimum_height_child;
+ natural_height = 3 * natural_height_child;
+ } else {
+ // If not wrapped, height is sum of child height and scrollbar height.
+
+ // Get horizontal scrollbar height.
+ int minimum_height_scrollbar = 0;
+ int natural_height_scrollbar = 0;
+ _scroller->get_hscrollbar()->get_preferred_height(minimum_height_scrollbar, natural_height_scrollbar);
-//void PreviewHolder::on_size_request( Gtk::Requisition* requisition )
-//{
-// g_message( "on_size_request(%d, %d)", requisition->width, requisition->height );
-// Gtk::VBox::on_size_request( requisition );
-// g_message( " super (%d, %d)", requisition->width, requisition->height );
-// g_message(" anchor:%d", _anchor);
-// g_message(" items:%d", (int)items.size());
-//}
+ minimum_height = minimum_height_child + minimum_height_scrollbar;
+ natural_height = natural_height_child + natural_height_scrollbar;
+ }
+}
/**
* Calculate the grid side of a preview holder
*
- * \param[in] thing
- * \param[in] itemCount The number of items to pack into the grid
- * \param[out] width The width of the grid
- * \param[out] height The height of the grid
+ * \param[in] item A sample preview widget.
+ * \param[in] itemCount The number of items to pack into the grid.
+ * \param[out] ncols The number of columns in grid.
+ * \param[out] nrows The number of rows in grid.
*/
-void PreviewHolder::calcGridSize( const Gtk::Widget* thing, int itemCount, int& width, int& height )
+void PreviewHolder::calcGridSize( const Gtk::Widget* item, int itemCount, int& ncols, int& nrows )
{
// Initially set all items in a horizontal row
- width = itemCount;
- height = 1;
+ ncols = itemCount;
+ nrows = 1;
#if GTK_CHECK_VERSION(3,16,0)
// Disable overlay scrolling as the scrollbar covers up swatches.
- // For some reason this also makes the height 55px.
- ((Gtk::ScrolledWindow *)_scroller)->set_overlay_scrolling(false);
+ _scroller->set_overlay_scrolling(false);
#endif
if ( _anchor == SP_ANCHOR_SOUTH || _anchor == SP_ANCHOR_NORTH ) {
- Gtk::Requisition req;
- Gtk::Requisition req_natural;
- _scroller->get_preferred_size(req, req_natural);
- int currW = _scroller->get_width();
- if ( currW > req.width ) {
- req.width = currW;
- }
+ // Horizontal layout, long bar.
- auto hs = dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->get_hscrollbar();
+ if (_wrap && item != NULL) {
- if ( hs ) {
- Gtk::Requisition scrollReq;
- Gtk::Requisition scrollReq_natural;
- hs->get_preferred_size(scrollReq, scrollReq_natural);
+ // Get width of bar.
+ int width_scroller = _scroller->get_width();
- // the +8 is a temporary hack
- req.height -= scrollReq.height + 8;
- }
+ // Get width of one item (must be visible).
+ int minimum_width_item = 0;
+ int natural_width_item = 0;
+ item->get_preferred_width(minimum_width_item, natural_width_item);
- Gtk::Requisition req2;
- Gtk::Requisition req2_natural;
- const_cast<Gtk::Widget*>(thing)->get_preferred_size(req2, req2_natural);
+ // Calculate columns and rows.
+ if (natural_width_item < 1) {
+ natural_width_item = 1;
+ }
+ ncols = width_scroller / natural_width_item - 1;
+ nrows = itemCount / ncols;
- int h2 = ((req2.height > 0) && (req.height > req2.height)) ? (req.height / req2.height) : 1;
- int w2 = ((req2.width > 0) && (req.width > req2.width)) ? (req.width / req2.width) : 1;
- width = (itemCount + (h2 - 1)) / h2;
- if ( width < w2 ) {
- width = w2;
+ // On first run, scroller width is not set correct... so we need to fudge it:
+ if (ncols < 2) {
+ ncols = itemCount/2;
+ nrows = 2;
+ }
}
} else {
- width = (_baseSize == PREVIEW_SIZE_SMALL || _baseSize == PREVIEW_SIZE_TINY) ? COLUMNS_FOR_SMALL : COLUMNS_FOR_LARGE;
+ ncols = (_baseSize == PREVIEW_SIZE_SMALL || _baseSize == PREVIEW_SIZE_TINY) ?
+ COLUMNS_FOR_SMALL : COLUMNS_FOR_LARGE;
if ( _prefCols > 0 ) {
- width = _prefCols;
+ ncols = _prefCols;
}
- height = (itemCount + (width - 1)) / width;
- if ( height < 1 ) {
- height = 1;
+ nrows = (itemCount + (ncols - 1)) / ncols;
+ if ( nrows < 1 ) {
+ nrows = 1;
}
}
}
void PreviewHolder::rebuildUI()
{
- _scroller->remove();
- _insides = 0; // remove() call should have deleted the Gtk::Table.
-
- switch(_view) {
- case VIEW_TYPE_LIST:
- {
- _insides = Gtk::manage(new Gtk::Grid());
- _insides->set_column_spacing(8);
+ auto children = _insides->get_children();
+ for (auto child : children) {
+ _insides->remove(*child);
+ }
- if (_border == BORDER_WIDE) {
- _insides->set_row_spacing(1);
- }
+ _insides->set_column_spacing(0);
+ _insides->set_row_spacing(0);
+ if (_border == BORDER_WIDE) {
+ _insides->set_column_spacing(1);
+ _insides->set_row_spacing(1);
+ }
- for ( unsigned int i = 0; i < items.size(); i++ ) {
- Gtk::Widget* label = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_BLURB, _view, _baseSize, _ratio, _border));
- //label->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
+ switch (_view) {
+ case VIEW_TYPE_LIST:
+ {
+ _insides->set_column_spacing(8);
- Gtk::Widget* thing = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, _view, _baseSize, _ratio, _border));
+ for ( unsigned int i = 0; i < items.size(); i++ ) {
+ Gtk::Widget* label = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_BLURB, _view, _baseSize, _ratio, _border));
+ //label->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
- thing->set_hexpand();
- thing->set_vexpand();
- _insides->attach(*thing, 0, i, 1, 1);
+ Gtk::Widget* item = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, _view, _baseSize, _ratio, _border));
- label->set_hexpand();
- label->set_valign(Gtk::ALIGN_CENTER);
- _insides->attach(*label, 1, i, 1, 1);
- }
+ item->set_hexpand();
+ item->set_vexpand();
+ _insides->attach(*item, 0, i, 1, 1);
- _scroller->add( *_insides );
+ label->set_hexpand();
+ label->set_valign(Gtk::ALIGN_CENTER);
+ _insides->attach(*label, 1, i, 1, 1);
}
- break;
+ }
+ break;
case VIEW_TYPE_GRID:
- {
- int col = 0;
- int row = 0;
- int width = 2;
- int height = 1;
-
- for ( unsigned int i = 0; i < items.size(); i++ ) {
-
- // If this is the last row, flag so the previews can draw a bottom
- ::BorderStyle border = ((row == height -1) && (_border == BORDER_SOLID)) ? BORDER_SOLID_LAST_ROW : _border;
- Gtk::Widget* thing = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, _view, _baseSize, _ratio, border));
-
- if ( !_insides ) {
- calcGridSize( thing, items.size(), width, height );
-
- _insides = Gtk::manage(new Gtk::Grid());
- if (_border == BORDER_WIDE) {
- _insides->set_column_spacing(1);
- _insides->set_row_spacing(1);
- }
- }
-
- thing->set_hexpand();
- thing->set_vexpand();
- _insides->attach( *thing, col, row, 1, 1);
-
- if ( ++col >= width ) {
- col = 0;
- row++;
- }
- }
- if ( !_insides ) {
- _insides = Gtk::manage(new Gtk::Grid());
+ {
+ int col = 0;
+ int row = 0;
+ int ncols = 2;
+ int nrows = 1;
+
+ for ( unsigned int i = 0; i < items.size(); i++ ) {
+
+ // If this is the last row, flag so the previews can draw a bottom
+ ::BorderStyle border = ((row == nrows -1) && (_border == BORDER_SOLID)) ?
+ BORDER_SOLID_LAST_ROW : _border;
+
+ Gtk::Widget* item = Gtk::manage(items[i]->getPreview(PREVIEW_STYLE_PREVIEW, _view, _baseSize, _ratio, border));
+ item->set_hexpand(false);
+ item->set_vexpand(false);
+
+ if (i == 0) {
+ // We need one item shown before we can call calcGridSize()...
+ _insides->attach( *item, 0, 0, 1, 1);
+ _scroller->show_all_children();
+ calcGridSize( item, items.size(), ncols, nrows );
+ } else {
+ // We've already calculated grid size.
+ _insides->attach( *item, col, row, 1, 1);
}
- _scroller->add( *_insides );
+ if ( ++col >= ncols ) {
+ col = 0;
+ row++;
+ }
}
+ }
}
_scroller->show_all_children();
diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h
index d370e8fc8..9f6d4807e 100644
--- a/src/ui/previewholder.h
+++ b/src/ui/previewholder.h
@@ -18,10 +18,10 @@
#endif
#include <gtkmm/box.h>
-#include <gtkmm/bin.h>
namespace Gtk {
class Grid;
+class ScrolledWindow;
}
#include "previewfillable.h"
@@ -31,7 +31,7 @@ class Grid;
namespace Inkscape {
namespace UI {
-class PreviewHolder : public Gtk::VBox, public PreviewFillable
+class PreviewHolder : public Gtk::Box, public PreviewFillable
{
public:
PreviewHolder();
@@ -49,21 +49,19 @@ public:
virtual ViewType getPreviewType() const { return _view; }
virtual guint getPreviewRatio() const { return _ratio; }
virtual ::BorderStyle getPreviewBorder() const { return _border; }
- virtual void setWrap( bool b );
+ virtual void setWrap( bool wrap );
virtual bool getWrap() const { return _wrap; }
protected:
- virtual void on_size_allocate( Gtk::Allocation& allocation );
+ virtual void get_preferred_height_vfunc(int& minimum_height, int& natural_height) const override;
virtual bool on_scroll_event(GdkEventScroll*);
-// virtual void on_size_request( Gtk::Requisition* requisition );
-
private:
void rebuildUI();
- void calcGridSize( const Gtk::Widget* thing, int itemCount, int& width, int& height );
+ void calcGridSize( const Gtk::Widget* item, int itemCount, int& ncols, int& nrows );
std::vector<Previewable*> items;
- Gtk::Bin *_scroller;
+ Gtk::ScrolledWindow *_scroller;
Gtk::Grid *_insides;
int _prefCols;
diff --git a/src/ui/widget/filter-effect-chooser.cpp b/src/ui/widget/filter-effect-chooser.cpp
index eace494ed..7a9d512ac 100644
--- a/src/ui/widget/filter-effect-chooser.cpp
+++ b/src/ui/widget/filter-effect-chooser.cpp
@@ -24,6 +24,8 @@ SimpleFilterModifier::SimpleFilterModifier(int flags)
_blend(BlendModeConverter, SP_ATTR_INVALID, false),
_blur(_("Blur (%)"), 0, 0, 100, 1, 0.01, 1)
{
+ set_name("SimpleFilterModifier");
+
_flags = flags;
if (flags & BLEND) {
diff --git a/src/ui/widget/spin-scale.h b/src/ui/widget/spin-scale.h
index d7030bed3..33731f256 100644
--- a/src/ui/widget/spin-scale.h
+++ b/src/ui/widget/spin-scale.h
@@ -15,7 +15,6 @@
#include <gtkmm/adjustment.h>
#include <gtkmm/box.h>
-#include <gtkmm/scale.h>
#include <gtkmm/togglebutton.h>
#include "spinbutton.h"
#include "attr-widget.h"
@@ -26,9 +25,9 @@ namespace Widget {
/**
* Wrap the gimpspinscale class
- * A combo widget with label, scale slider, spinbutton and adjustment
+ * A combo widget with label, scale slider, spinbutton, and adjustment
*/
-class SpinScale : public Gtk::HBox, public AttrWidget
+class SpinScale : public Gtk::Box, public AttrWidget
{
public:
@@ -64,7 +63,7 @@ public:
*
* @see SpinScale
*/
-class DualSpinScale : public Gtk::HBox, public AttrWidget
+class DualSpinScale : public Gtk::Box, public AttrWidget
{
public:
DualSpinScale(const char* label1, const char* label2, double value, double lower, double upper, double step_inc,
diff --git a/src/ui/widget/spin-slider.cpp b/src/ui/widget/spin-slider.cpp
index f17b9b26c..03981763d 100644
--- a/src/ui/widget/spin-slider.cpp
+++ b/src/ui/widget/spin-slider.cpp
@@ -23,6 +23,7 @@ SpinSlider::SpinSlider(double value, double lower, double upper, double step_inc
_adjustment(Gtk::Adjustment::create(value, lower, upper, step_inc)),
_scale(_adjustment), _spin(_adjustment, climb_rate, digits)
{
+ set_name("SpinSlider");
signal_value_changed().connect(signal_attr_changed().make_slot());
pack_start(_scale);