Skip to content

Commit

Permalink
Add option to use Cairo render on Work Area
Browse files Browse the repository at this point in the history
  • Loading branch information
genete committed Mar 9, 2013
1 parent bc08c9b commit 9e46e10
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
14 changes: 14 additions & 0 deletions synfig-studio/src/gui/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ String studio::App::browser_command("xdg-open"); // Linux XDG standard
#endif
String studio::App::sequence_separator(".");
bool studio::App::navigator_uses_cairo=false;
bool studio::App::workarea_uses_cairo=false;

static int max_recent_files_=25;
int studio::App::get_max_recent_files() { return max_recent_files_; }
Expand Down Expand Up @@ -600,6 +601,11 @@ class Preferences : public synfigapp::Settings
value=strprintf("%i",(int)App::navigator_uses_cairo);
return true;
}
if(key=="workarea_uses_cairo")
{
value=strprintf("%i",(int)App::workarea_uses_cairo);
return true;
}
}
catch(...)
{
Expand Down Expand Up @@ -726,6 +732,12 @@ class Preferences : public synfigapp::Settings
App::navigator_uses_cairo=i;
return true;
}
if(key=="workarea_uses_cairo")
{
int i(atoi(value.c_str()));
App::workarea_uses_cairo=i;
return true;
}
}
catch(...)
{
Expand Down Expand Up @@ -757,6 +769,7 @@ class Preferences : public synfigapp::Settings
ret.push_back("predefined_fps");
ret.push_back("sequence_separator");
ret.push_back("navigator_uses_cairo");
ret.push_back("workarea_uses_cairo");
return ret;
}
};
Expand Down Expand Up @@ -1876,6 +1889,7 @@ App::reset_initial_preferences()
synfigapp::Main::settings().set_value("pref.predefined_fps",DEFAULT_PREDEFINED_FPS);
synfigapp::Main::settings().set_value("sequence_separator", ".");
synfigapp::Main::settings().set_value("navigator_uses_cairo", "0");
synfigapp::Main::settings().set_value("workarea_uses_cairo", "0");
}

bool
Expand Down
1 change: 1 addition & 0 deletions synfig-studio/src/gui/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ class App : public Gtk::Main, private IconController
static float preferred_fps;
static synfig::String sequence_separator;
static bool navigator_uses_cairo;
static bool workarea_uses_cairo;
/*
-- ** -- S I G N A L S -------------------------------------------------------
*/
Expand Down
9 changes: 9 additions & 0 deletions synfig-studio/src/gui/dialogs/dialog_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ Dialog_Setup::Dialog_Setup():
// Render - Use Cairo on Navigator
attach_label(render_table, _("Use Cairo render on Navigator"), 1, xpadding, ypadding);
render_table->attach(toggle_navigator_uses_cairo, 1, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);
// Render - Use Cairo on WorkArea
attach_label(render_table, _("Use Cairo render on WorkArea"), 2, xpadding, ypadding);
render_table->attach(toggle_workarea_uses_cairo, 1, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::SHRINK|Gtk::FILL, xpadding, ypadding);

show_all_children();
}
Expand Down Expand Up @@ -372,6 +375,9 @@ Dialog_Setup::on_apply_pressed()
// Set the navigator uses cairo flag
App::navigator_uses_cairo=toggle_navigator_uses_cairo.get_active();

// Set the workarea uses cairo flag
App::workarea_uses_cairo=toggle_workarea_uses_cairo.get_active();

App::save_settings();

App::setup_changed();
Expand Down Expand Up @@ -525,6 +531,9 @@ Dialog_Setup::refresh()

// Refresh the status of the navigator_uses_cairo flag
toggle_navigator_uses_cairo.set_active(App::navigator_uses_cairo);

// Refresh the status of the workarea_uses_cairo flag
toggle_workarea_uses_cairo.set_active(App::workarea_uses_cairo);
}

GammaPattern::GammaPattern():
Expand Down
1 change: 1 addition & 0 deletions synfig-studio/src/gui/dialogs/dialog_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ class Dialog_Setup : public Gtk::Dialog

Gtk::Entry image_sequence_separator;
Gtk::CheckButton toggle_navigator_uses_cairo;
Gtk::CheckButton toggle_workarea_uses_cairo;
public:

void set_time_format(synfig::Time::Format time_format);
Expand Down

0 comments on commit 9e46e10

Please sign in to comment.