diff --git a/src/config.cpp b/src/config.cpp index 3190162..54499ea 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -22,6 +22,7 @@ void Config::Read() CellPadding = group->GetValue("cellpadding", 3); FontSize = group->GetValue("fontsize", 10); FontFace = group->GetValue("fontface", "Sans"); + Antialias = group->GetValue("antialias", false); group = ini.GetGroup("general"); UseConnections = group->GetValue("useconnections", true); @@ -60,6 +61,7 @@ void Config::Write() group->SetValue("cellpadding", CellPadding); group->SetValue("fontsize", FontSize); group->SetValue("fontface", FontFace); + group->SetValue("antialias", Antialias); group = ini.GetGroup("general"); group->SetValue("useconnections", UseConnections); diff --git a/src/config.h b/src/config.h index 2e2b612..c50ab86 100644 --- a/src/config.h +++ b/src/config.h @@ -13,6 +13,7 @@ public: int CellPadding; int FontSize; + bool Antialias; std::string FontFace; bool UseConnections; diff --git a/src/jsweeper.glade b/src/jsweeper.glade index 1763983..1a93ed8 100644 --- a/src/jsweeper.glade +++ b/src/jsweeper.glade @@ -1,6 +1,6 @@ - + JACK Sweeper @@ -772,33 +772,31 @@ True - 2 + 3 2 6 6 - + True True - 0 0 100 1 10 10 + Antialias grid + 0 + True - 1 2 - 1 - 2 - GTK_FILL + 2 + 3 - + True 0 - Cell padding: + Font: - 1 - 2 GTK_FILL @@ -816,12 +814,28 @@ - + True 0 - Font: + Cell padding: + 1 + 2 + GTK_FILL + + + + + True + True + 0 0 100 1 10 10 + + + 1 + 2 + 1 + 2 GTK_FILL @@ -876,147 +890,53 @@ 6 6 - + True + 0 + Background: - 2 - 3 - 4 - 5 GTK_FILL - + True 0 - Grid lines (ports): + Client tabs: - 2 - 3 - 3 - 4 - GTK_FILL - - - - - True - 0 - Grid lines (groups): - - - 2 - 3 - 2 - 3 - GTK_FILL - - - - - True - 0 - Grid lines (clients): - - - 2 - 3 1 2 GTK_FILL - - True - - - 3 - 4 - 4 - 5 - GTK_FILL - - - - - True - True - True - 0 - #000000000000 - - - 3 - 4 - 3 - 4 - - - - - - True - True - True - 0 - #000000000000 - - - 3 - 4 - 2 - 3 - - - - - - True - True - True - 0 - #000000000000 - - - 3 - 4 - 1 - 2 - - - - - - True - True - True - 0 - #000000000000 - - - 3 - 4 - - - - - + True 0 - Foreground: + Port group tabs: - 2 - 3 + 2 + 3 GTK_FILL - + + True + 0 + Audio port tabs: + + + 3 + 4 + GTK_FILL + + + + True True True @@ -1026,25 +946,11 @@ 1 2 - 4 - 5 - GTK_EXPAND + - - True - 0 - MIDI port tabs: - - - 4 - 5 - GTK_FILL - - - - + True True True @@ -1054,8 +960,8 @@ 1 2 - 3 - 4 + 1 + 2 GTK_EXPAND @@ -1076,7 +982,7 @@ - + True True True @@ -1086,13 +992,25 @@ 1 2 - 1 - 2 + 3 + 4 GTK_EXPAND - + + True + 0 + MIDI port tabs: + + + 4 + 5 + GTK_FILL + + + + True True True @@ -1102,52 +1020,148 @@ 1 2 - + 4 + 5 + GTK_EXPAND - + True 0 - Audio port tabs: + Foreground: - 3 - 4 + 2 + 3 GTK_FILL - + True - 0 - Port group tabs: + True + True + 0 + #000000000000 + 3 + 4 + + + + + + True + True + True + 0 + #000000000000 + + + 3 + 4 + 1 + 2 + + + + + + True + True + True + 0 + #000000000000 + + + 3 + 4 + 2 + 3 + + + + + + True + True + True + 0 + #000000000000 + + + 3 + 4 + 3 + 4 + + + + + + True + + + 3 + 4 + 4 + 5 + GTK_FILL + + + + + True + 0 + Grid lines (clients): + + + 2 + 3 + 1 + 2 + GTK_FILL + + + + + True + 0 + Grid lines (groups): + + + 2 + 3 2 3 GTK_FILL - + True 0 - Client tabs: + Grid lines (ports): - 1 - 2 + 2 + 3 + 3 + 4 GTK_FILL - + True - 0 - Background: + 2 + 3 + 4 + 5 GTK_FILL @@ -1267,19 +1281,65 @@ 6 6 - + True True - Disconnect ports on match + + + 1 + 2 + 1 + 2 + + + + + True + True + + + 1 + 2 + + + + + True + 0 + _Destination match rule: + True + True + + + 1 + 2 + GTK_FILL + + + + + True + 0 + _Source match rule: + True + True + + + GTK_FILL + + + + + True + True + Stop after matching rule 0 - True True - radiobutton1 2 - 3 - 4 + 4 + 5 GTK_FILL @@ -1300,68 +1360,22 @@ - + True True - Stop after matching rule + Disconnect ports on match 0 + True True + radiobutton1 2 - 4 - 5 + 3 + 4 GTK_FILL - - - True - 0 - _Source match rule: - True - True - - - GTK_FILL - - - - - True - 0 - _Destination match rule: - True - True - - - 1 - 2 - GTK_FILL - - - - - True - True - - - 1 - 2 - - - - - True - True - - - 1 - 2 - 1 - 2 - - False @@ -1425,29 +1439,25 @@ 6 6 - + True True - Stop after matching rule - 0 - True + 1 2 - 2 - 3 + 1 + 2 - + True - 0 - _Match rule: - True - True + True - GTK_FILL + 1 + 2 @@ -1465,25 +1475,29 @@ - + True - True + 0 + _Match rule: + True + True - 1 - 2 + GTK_FILL - + True True + Stop after matching rule + 0 + True - 1 2 - 1 - 2 + 2 + 3 diff --git a/src/matrix.cpp b/src/matrix.cpp index 451373f..2466565 100644 --- a/src/matrix.cpp +++ b/src/matrix.cpp @@ -332,7 +332,9 @@ bool Matrix::on_expose_event(GdkEventExpose *event) cr->clip(); cr->set_line_width(1.0); - cr->set_antialias(Cairo::ANTIALIAS_NONE); + if (!cfg.Antialias) { + cr->set_antialias(Cairo::ANTIALIAS_NONE); + } cr->translate(0.5, 0.5); // Clear background diff --git a/src/preferences_gui.cpp b/src/preferences_gui.cpp index 2f8ddc4..1b767d5 100644 --- a/src/preferences_gui.cpp +++ b/src/preferences_gui.cpp @@ -33,6 +33,7 @@ Preferences::Preferences(BaseObjectType *cobject, const Glib::RefPtrget_widget("fontbutton_font", fontbutton_font); builder->get_widget("spin_cell_padding", spin_cell_padding); + builder->get_widget("check_antialias", check_antialias); builder->get_widget("colorbutton_background", colour_background); builder->get_widget("colorbutton_clients", colour_clients); @@ -66,6 +67,7 @@ Preferences::Preferences(BaseObjectType *cobject, const Glib::RefPtrset_font_name(font); spin_cell_padding->set_value(cfg.CellPadding); + check_antialias->set_active(cfg.Antialias); colour_background->set_color(cfg.Background.colour); colour_clients->set_color(cfg.TabClient.colour); @@ -92,6 +94,7 @@ Preferences::Preferences(BaseObjectType *cobject, const Glib::RefPtrsignal_font_set().connect(sigc::mem_fun(*this, &Preferences::on_fontbutton_font_click)); spin_cell_padding->signal_value_changed().connect(sigc::mem_fun(*this, &Preferences::on_spin_cell_padding_click)); + check_antialias->signal_clicked().connect(sigc::mem_fun(*this, &Preferences::on_check_antialias_click)); } Preferences *Preferences::Open() @@ -246,3 +249,9 @@ void Preferences::on_spin_cell_padding_click() cfg.CellPadding = spin_cell_padding->get_value(); g->Refresh(); } + +void Preferences::on_check_antialias_click() +{ + cfg.Antialias = check_antialias->get_active(); +} + diff --git a/src/preferences_gui.h b/src/preferences_gui.h index 8ab0e8f..38d583f 100644 --- a/src/preferences_gui.h +++ b/src/preferences_gui.h @@ -38,6 +38,7 @@ private: // Grid layout Gtk::FontButton *fontbutton_font; Gtk::SpinButton *spin_cell_padding; + Gtk::CheckButton *check_antialias; // Colours Gtk::ColorButton *colour_background; @@ -72,6 +73,7 @@ protected: void on_fontbutton_font_click(); void on_spin_cell_padding_click(); + void on_check_antialias_click(); class ModelColumns : public Gtk::TreeModel::ColumnRecord {