summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-04-15 15:19:58 +0200
committerRobin Gareus <robin@gareus.org>2017-04-15 15:19:58 +0200
commit18dcd4d7ff2855e87fc78395f2009ebafd24cc7a (patch)
tree06aad2c10df21332e83ba9449bdf721f9e607c46
parent60c12df5171932a16437981846f547378213dba4 (diff)
FP8: Configuration UI layout & design (add image, separators)
-rw-r--r--gtk2_ardour/icons/faderport8-small.pngbin0 -> 63093 bytes
-rw-r--r--libs/surfaces/faderport8/gui.cc35
-rw-r--r--libs/surfaces/faderport8/gui.h1
3 files changed, 29 insertions, 7 deletions
diff --git a/gtk2_ardour/icons/faderport8-small.png b/gtk2_ardour/icons/faderport8-small.png
new file mode 100644
index 0000000000..c5efb05c25
--- /dev/null
+++ b/gtk2_ardour/icons/faderport8-small.png
Binary files differ
diff --git a/libs/surfaces/faderport8/gui.cc b/libs/surfaces/faderport8/gui.cc
index 8b8673bb3b..3bd9a9464e 100644
--- a/libs/surfaces/faderport8/gui.cc
+++ b/libs/surfaces/faderport8/gui.cc
@@ -20,6 +20,7 @@
#include <gtkmm/alignment.h>
#include <gtkmm/label.h>
#include <gtkmm/liststore.h>
+#include <gtkmm/separator.h>
#include "pbd/unwind.h"
#include "pbd/strsplit.h"
@@ -89,6 +90,16 @@ FP8GUI::FP8GUI (FaderPort8& p)
table.set_border_width (12);
table.set_homogeneous (false);
+ std::string data_file_path;
+ string name = "faderport8-small.png";
+ Searchpath spath(ARDOUR::ardour_data_search_path());
+ spath.add_subdirectory_to_paths ("icons");
+ find_file (spath, name, data_file_path);
+ if (!data_file_path.empty()) {
+ image.set (data_file_path);
+ hpacker.pack_start (image, false, false);
+ }
+
Gtk::Label* l;
int row = 0;
@@ -101,18 +112,23 @@ FP8GUI::FP8GUI (FaderPort8& p)
l = manage (new Gtk::Label);
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Incoming MIDI on:")));
l->set_alignment (1.0, 0.5);
- table.attach (*l, 0, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
- table.attach (input_combo, 2, 6, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
+ table.attach (*l, 1, 4, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
+ table.attach (input_combo, 4, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
row++;
l = manage (new Gtk::Label);
l->set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Outgoing MIDI on:")));
l->set_alignment (1.0, 0.5);
- table.attach (*l, 0, 2, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
- table.attach (output_combo, 2, 6, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
+ table.attach (*l, 1, 4, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0));
+ table.attach (output_combo, 4, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 0);
+ row++;
+
+ Gtk::HSeparator *hsep = manage(new Gtk::HSeparator);
+ table.attach (*hsep, 0, 8, row, row+1, AttachOptions(FILL|EXPAND), AttachOptions(0), 0, 6);
row++;
- pack_start (table);
+ hpacker.pack_start (table, true, true);
+ pack_start (hpacker, false, false);
/* actions */
build_available_action_menu ();
@@ -128,11 +144,11 @@ FP8GUI::FP8GUI (FaderPort8& p)
l = manage (new Gtk::Label);
l->set_markup (string_compose ("<span weight=\"bold\">%1:</span>", i->second));
l->set_alignment (1.0, 0.5);
- table.attach (*l, 2 * action_col, 2 * action_col + 1, row + action_row, row + action_row + 1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ table.attach (*l, 3 * action_col, 3 * action_col + 1, row + action_row, row + action_row + 1, AttachOptions(FILL|EXPAND), AttachOptions (0));
align = manage (new Alignment);
align->set (0.0, 0.5);
align->add (*user_combo);
- table.attach (*align, 2 * action_col + 1, 2 * action_col + 2, row + action_row, row + action_row + 1, AttachOptions(FILL|EXPAND), AttachOptions (0));
+ table.attach (*align, 3 * action_col + 1, 3 * action_col + 2, row + action_row, row + action_row + 1, AttachOptions(FILL|EXPAND), AttachOptions (0));
if (++action_row == 4) {
action_row = 0;
@@ -140,6 +156,11 @@ FP8GUI::FP8GUI (FaderPort8& p)
}
}
+ for (int c = 0; c < 2; ++c) {
+ Gtk::VSeparator *vsep = manage(new Gtk::VSeparator);
+ table.attach (*vsep, 3 * c + 2, 3 * c + 3, row, row + 4, AttachOptions(0), AttachOptions(FILL), 6, 0);
+ }
+
/* update the port connection combos */
update_port_combos ();
diff --git a/libs/surfaces/faderport8/gui.h b/libs/surfaces/faderport8/gui.h
index 20b9ebfedf..c7bc91080f 100644
--- a/libs/surfaces/faderport8/gui.h
+++ b/libs/surfaces/faderport8/gui.h
@@ -46,6 +46,7 @@ public:
private:
FaderPort8& fp;
+ Gtk::HBox hpacker;
Gtk::Table table;
Gtk::Image image;