summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71ccb1a)
raw | patch | inline | side by side (parent: 71ccb1a)
author | gustav_b <gustav_b@users.sourceforge.net> | |
Tue, 25 Sep 2007 23:23:44 +0000 (23:23 +0000) | ||
committer | gustav_b <gustav_b@users.sourceforge.net> | |
Tue, 25 Sep 2007 23:23:44 +0000 (23:23 +0000) |
floating docks.
src/ui/widget/dock-item.cpp | patch | blob | history | |
src/ui/widget/dock-item.h | patch | blob | history | |
src/ui/widget/dock.cpp | patch | blob | history | |
src/ui/widget/dock.h | patch | blob | history |
index 2187c33e907c2e48fc84071d694aff289c86ae23..74cc44be9a3ec86a7d848bca5b653888872412d1 100644 (file)
bool
DockItem::isFloating() const
{
- gboolean floating = FALSE;
- if (GDL_IS_DOCK (gdl_dock_object_get_parent_object (GDL_DOCK_OBJECT (_gdl_dock_item)))) {
- GdlDock* dock = GDL_DOCK (gdl_dock_object_get_parent_object (GDL_DOCK_OBJECT (_gdl_dock_item)));
- g_object_get (dock,
- "floating", &floating,
- NULL);
- }
- return floating;
+ return (GTK_WIDGET(gdl_dock_object_get_toplevel(GDL_DOCK_OBJECT (_gdl_dock_item))) !=
+ _dock.getGdlWidget());
}
bool
{
_window = getWindow();
- if (new_state == FLOATING_STATE) {
+ if (new_state == FLOATING_STATE && _window) {
_window->signal_hide().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onHideWindow));
_signal_key_press_event_connection =
_window->signal_key_press_event().connect(sigc::mem_fun(*this, &Inkscape::UI::Widget::DockItem::_onKeyPress));
index d2881c0053263709f4e064c511b6fa557b7b7961..af2f3ac7022b21e4e73b5af5c47eb0c22735d4c5 100644 (file)
public:
- enum State { UNATTACHED, FLOATING_STATE, DOCKED_STATE };
+ enum State { UNATTACHED, // item not bound to the dock (a temporary state)
+ FLOATING_STATE, // item not in its dock (but can be docked in other,
+ // e.g. floating, docks)
+ DOCKED_STATE }; // item in its assigned dock
enum Placement {
NONE = GDL_DOCK_NONE,
diff --git a/src/ui/widget/dock.cpp b/src/ui/widget/dock.cpp
index f282449dd0994bda824c573b3e4363e953c69630..ae19ed8d6fa5197dbe9e6ad2ccec9d789ed5facf 100644 (file)
--- a/src/ui/widget/dock.cpp
+++ b/src/ui/widget/dock.cpp
return _paned;
}
+GtkWidget *
+Dock::getGdlWidget()
+{
+ return GTK_WIDGET(_gdl_dock);
+}
bool
Dock::isEmpty() const
diff --git a/src/ui/widget/dock.h b/src/ui/widget/dock.h
index 3cd29c01f5428b4f99e6ce1d7adf10aaa8022fb3..b5ecc02cabed6ac68b9b3146b630b1db2534b9dc 100644 (file)
--- a/src/ui/widget/dock.h
+++ b/src/ui/widget/dock.h
Gtk::Widget& getWidget(); //< return the top widget
Gtk::Paned *getParentPaned();
-
Gtk::Paned *getPaned();
- bool isEmpty() const; //< true iff none of the dock's items are in state != UNATTACHED
+ GtkWidget* getGdlWidget(); //< return the top gdl widget
+
+ bool isEmpty() const; //< true iff none of the dock's items are in a docked state
bool hasIconifiedItems() const;
Glib::SignalProxy0<void> signal_layout_changed();