#include "dialogsettings.h"
#include <synfigapp/main.h>
+#include <gdkmm/general.h>
#include "general.h"
bool
DialogSettings::set_value(const synfig::String& key,const synfig::String& value)
{
+ int screen_w(Gdk::screen_width());
+ int screen_h(Gdk::screen_height());
+
if(value.empty())
return false;
int x,y;
if(!strscanf(value,"%d %d",&x, &y))
return false;
+
+ if (x > screen_w) x = screen_w - 150; if (x < 0) x = 0;
+ if (y > screen_h) y = screen_h - 150; if (y < 0) y = 0;
+
window->move(x,y);
return true;
}
int x,y;
if(!strscanf(value,"%d %d",&x, &y))
return false;
+
+ if (x > screen_w) x = 150; if (x < 0) x = 0;
+ if (y > screen_h) y = 150; if (y < 0) y = 0;
+
window->set_default_size(x,y);
return true;
}
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:
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;
dock_dialog.move(x,y);
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);