summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2006-02-18 08:56:22 +0000
committerjoncruz <joncruz@users.sourceforge.net>2006-02-18 08:56:22 +0000
commitcb3c4232c369855e07227f75c04673182f6461c0 (patch)
tree24645f010f65be595f4be0ecd0b1f7550bb00c88 /src/ui
parentupdates from Lucas and Colin (diff)
downloadinkscape-cb3c4232c369855e07227f75c04673182f6461c0.tar.gz
inkscape-cb3c4232c369855e07227f75c04673182f6461c0.zip
Removed horizontal scroll bar from swatches when embedded.
(bzr r155)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/previewfillable.h1
-rw-r--r--src/ui/previewholder.cpp28
-rw-r--r--src/ui/previewholder.h2
3 files changed, 31 insertions, 0 deletions
diff --git a/src/ui/previewfillable.h b/src/ui/previewfillable.h
index 106eda7ea..b62ab6b99 100644
--- a/src/ui/previewfillable.h
+++ b/src/ui/previewfillable.h
@@ -26,6 +26,7 @@ public:
virtual void clear() = 0;
virtual void addPreview( Previewable* preview ) = 0;
virtual void setStyle(Gtk::BuiltinIconSize size, ViewType type) = 0;
+ virtual void setOrientation( Gtk::AnchorType how ) = 0;
virtual Gtk::BuiltinIconSize getPreviewSize() const = 0;
virtual ViewType getPreviewType() const = 0;
};
diff --git a/src/ui/previewholder.cpp b/src/ui/previewholder.cpp
index e73cd7407..321b7899f 100644
--- a/src/ui/previewholder.cpp
+++ b/src/ui/previewholder.cpp
@@ -24,6 +24,7 @@ PreviewHolder::PreviewHolder() :
VBox(),
PreviewFillable(),
_scroller(0),
+ _anchor(Gtk::ANCHOR_CENTER),
_baseSize(Gtk::ICON_SIZE_MENU),
_view(VIEW_TYPE_LIST)
{
@@ -84,6 +85,33 @@ void PreviewHolder::setStyle(Gtk::BuiltinIconSize size, ViewType view)
}
}
+void PreviewHolder::setOrientation( Gtk::AnchorType how )
+{
+ if ( _anchor != how )
+ {
+ switch ( _anchor )
+ {
+ case Gtk::ANCHOR_NORTH:
+ case Gtk::ANCHOR_SOUTH:
+ {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_NEVER );
+ }
+ break;
+
+ case Gtk::ANCHOR_EAST:
+ case Gtk::ANCHOR_WEST:
+ {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC );
+ }
+ break;
+
+ default:
+ {
+ dynamic_cast<Gtk::ScrolledWindow*>(_scroller)->set_policy( Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC );
+ }
+ }
+ }
+}
void PreviewHolder::rebuildUI()
{
diff --git a/src/ui/previewholder.h b/src/ui/previewholder.h
index 96d9b8228..532aa771f 100644
--- a/src/ui/previewholder.h
+++ b/src/ui/previewholder.h
@@ -30,6 +30,7 @@ public:
virtual void clear();
virtual void addPreview( Previewable* preview );
virtual void setStyle(Gtk::BuiltinIconSize size, ViewType view);
+ virtual void setOrientation( Gtk::AnchorType how );
virtual Gtk::BuiltinIconSize getPreviewSize() const { return _baseSize; }
virtual ViewType getPreviewType() const { return _view; }
@@ -39,6 +40,7 @@ private:
std::vector<Previewable*> items;
Gtk::Bin *_scroller;
Gtk::Table *_insides;
+ Gtk::AnchorType _anchor;
Gtk::BuiltinIconSize _baseSize;
ViewType _view;
};