summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d5fe587)
raw | patch | inline | side by side (parent: d5fe587)
author | gustav_b <gustav_b@users.sourceforge.net> | |
Thu, 6 Sep 2007 00:32:22 +0000 (00:32 +0000) | ||
committer | gustav_b <gustav_b@users.sourceforge.net> | |
Thu, 6 Sep 2007 00:32:22 +0000 (00:32 +0000) |
preference "options.dialogscancenterdock" to allow users to disable it
completely.
completely.
index 11c0d3127f23dd50585408c8ffd15060429ccf38..c22ea038c5e301054e420b4965c65f7f98fc684e 100644 (file)
GtkWidget *widget)
{
GdlDockPlaceholder *ph;
- GdlDockPlacement pos = GDL_DOCK_CENTER; /* default position */
+ GdlDockPlacement pos = GDL_DOCK_TOP; /* default position */
g_return_if_fail (GDL_IS_DOCK_PLACEHOLDER (container));
g_return_if_fail (GDL_IS_DOCK_ITEM (widget));
- if (GDL_DOCK_ITEM (widget)->behavior & GDL_DOCK_ITEM_BEH_CANT_DOCK_CENTER)
- pos = GDL_DOCK_TOP;
-
ph = GDL_DOCK_PLACEHOLDER (container);
if (ph->_priv->placement_stack)
pos = (GdlDockPlacement) ph->_priv->placement_stack->data;
diff --git a/src/libgdl/gdl-dock.c b/src/libgdl/gdl-dock.c
index cb3e1b3725695577441626799988bfdfc41f5693..7c74791db50fa75426c28a10cf358e9835e81893 100644 (file)
--- a/src/libgdl/gdl-dock.c
+++ b/src/libgdl/gdl-dock.c
if (placement == GDL_DOCK_LEFT || placement == GDL_DOCK_RIGHT) {
/* Check if dock_object touches center in terms of width */
- if (GTK_WIDGET (dock)->allocation.width/2 > object_size.width &&
- !(dock_item->behavior & GDL_DOCK_ITEM_BEH_CANT_DOCK_CENTER)) {
- return GDL_DOCK_CENTER;
+ if (GTK_WIDGET (dock)->allocation.width/2 > object_size.width) {
+ return GDL_DOCK_TOP;
}
- } else if (placement == GDL_DOCK_TOP || placement == GDL_DOCK_BOTTOM) {
- /* Check if dock_object touches center in terms of height */
- if (GTK_WIDGET (dock)->allocation.height/2 > object_size.height &&
- !(dock_item->behavior & GDL_DOCK_ITEM_BEH_CANT_DOCK_CENTER)) {
- return GDL_DOCK_CENTER;
- }
- }
+ }
+
return placement;
}
index 208b822f239fe5860f01e7ce4010695fddd758be..97d399f2891179bde36f0ca930724b4d37f440b5 100644 (file)
" <group id=\"autoscrolldistance\" value=\"-10\"/>\n"
" <group id=\"simplifythreshold\" value=\"0.002\"/>\n"
" <group id=\"dialogtype\" value=\"1\"/>\n"
+" <group id=\"dialogscancenterdock\" value=\"1\"/>\n"
" <group id=\"dialogsskiptaskbar\" value=\"1\"/>\n"
#ifdef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
" <group id=\"dialogsontopwin32\" value=\"0\"/>\n"
index 97f11f56eadd30af91f26f3bfe686075db45a580..46a2667c7b125ea4b4fe5c4543b98c560915825e 100644 (file)
#include "dock-item.h"
#include "desktop.h"
#include "inkscape.h"
+#include "prefs-utils.h"
#include "ui/widget/dock.h"
#include "widgets/icon.h"
}
+ GdlDockItemBehavior gdl_dock_behavior =
+ (prefs_get_int_attribute_limited ("options.dialogscancenterdock", "value", 1, 0, 1) == 0 ?
+ GDL_DOCK_ITEM_BEH_CANT_DOCK_CENTER
+ : GDL_DOCK_ITEM_BEH_NORMAL);
+
if (!icon_name.empty()) {
Gtk::Widget *icon = sp_icon_get_icon(icon_name, Inkscape::ICON_SIZE_MENU);
if (icon) {
@@ -62,12 +68,12 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l
delete icon;
_gdl_dock_item =
- gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(), _icon_pixbuf->gobj(),
- GDL_DOCK_ITEM_BEH_NORMAL);
+ gdl_dock_item_new_with_pixbuf_icon(name.c_str(), long_name.c_str(),
+ _icon_pixbuf->gobj(), gdl_dock_behavior);
}
} else {
_gdl_dock_item =
- gdl_dock_item_new(name.c_str(), long_name.c_str(), GDL_DOCK_ITEM_BEH_NORMAL);
+ gdl_dock_item_new(name.c_str(), long_name.c_str(), gdl_dock_behavior);
}
_frame.set_shadow_type(Gtk::SHADOW_IN);