X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fdockmanager.cpp;h=8a5198ca22c6f684b2e8e553ff05cc35062163d0;hb=756c0d29ac1742f231e6615f9a577e574e35a4af;hp=dcf23a71f9c3214b9b8c5fc1969403ecc3b269a9;hpb=7532507478b746b4050a841b45f1ac11f5b24d31;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/dockmanager.cpp b/synfig-studio/trunk/src/gtkmm/dockmanager.cpp index dcf23a7..8a5198c 100644 --- a/synfig-studio/trunk/src/gtkmm/dockmanager.cpp +++ b/synfig-studio/trunk/src/gtkmm/dockmanager.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007, 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -37,6 +38,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -132,7 +135,8 @@ public: if(key=="contents_size") { try { - + int width, height; + Gtk::IconSize::lookup(Gtk::IconSize(4),width,height); vector data; String::size_type n=0; String value_(value); @@ -141,7 +145,14 @@ public: int size; if(!strscanf(value_,"%d",&size)) break; + if (size > SCALE_FACTOR) size = SCALE_FACTOR - 150; + if (size < 0) size = 0; size=size*screen_h/SCALE_FACTOR; + + // prevent errors like this, by allowing space for at least the dockable's icon: + // ** CRITICAL **: clearlooks_style_draw_box_gap: assertion `height >= -1' failed + if (size < height + 9) size = height + 9; + data.push_back(size); n=value_.find(" "); @@ -163,8 +174,14 @@ public: int x,y; if(!strscanf(value,"%d %d",&x, &y)) return false; + if (x > SCALE_FACTOR) x = SCALE_FACTOR - 150; if (x < 0) x = 0; + if (y > SCALE_FACTOR) y = SCALE_FACTOR - 150; if (y < 0) y = 0; x=x*screen_w/SCALE_FACTOR; y=y*screen_h/SCALE_FACTOR; + if(getenv("SYNFIG_WINDOW_POSITION_X_OFFSET")) + x += atoi(getenv("SYNFIG_WINDOW_POSITION_X_OFFSET")); + if(getenv("SYNFIG_WINDOW_POSITION_Y_OFFSET")) + y += atoi(getenv("SYNFIG_WINDOW_POSITION_Y_OFFSET")); dock_dialog.move(x,y); return true; } @@ -173,6 +190,8 @@ public: int x,y; if(!strscanf(value,"%d %d",&x, &y)) return false; + if (x > SCALE_FACTOR) x = 150; if (x < 0) x = 0; + if (y > SCALE_FACTOR) y = 150; if (y < 0) y = 0; x=x*screen_w/SCALE_FACTOR; y=y*screen_h/SCALE_FACTOR; dock_dialog.set_default_size(x,y); @@ -229,7 +248,7 @@ DockManager::~DockManager() while(!dockable_list_.empty()) { Dockable* dockable(dockable_list_.back()); - synfig::info("DockManager::~DockManager(): Deleting dockable \"%s\"",dockable->get_name().c_str()); + // synfig::info("DockManager::~DockManager(): Deleting dockable \"%s\"",dockable->get_name().c_str()); dockable_list_.pop_back(); delete dockable; }