some tweaks to the UI of the dynamic profile editor
This commit is contained in:
parent
153e28deae
commit
f67d903550
@ -207,10 +207,9 @@ DynamicProfilePanel::DynamicProfilePanel():
|
|||||||
{
|
{
|
||||||
add(vbox_);
|
add(vbox_);
|
||||||
|
|
||||||
//Add the TreeView, inside a ScrolledWindow, with the button underneath:
|
treeview_.set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_VERTICAL);
|
||||||
scrolledwindow_.add(treeview_);
|
scrolledwindow_.add(treeview_);
|
||||||
|
|
||||||
//Only show the scrollbars when they are necessary:
|
|
||||||
scrolledwindow_.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
scrolledwindow_.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
vbox_.pack_start(scrolledwindow_);
|
vbox_.pack_start(scrolledwindow_);
|
||||||
@ -234,11 +233,9 @@ DynamicProfilePanel::DynamicProfilePanel():
|
|||||||
button_delete_.signal_clicked().connect(
|
button_delete_.signal_clicked().connect(
|
||||||
sigc::mem_fun(*this, &DynamicProfilePanel::on_button_delete));
|
sigc::mem_fun(*this, &DynamicProfilePanel::on_button_delete));
|
||||||
|
|
||||||
//Create the Tree model:
|
|
||||||
treemodel_ = Gtk::ListStore::create(columns_);
|
treemodel_ = Gtk::ListStore::create(columns_);
|
||||||
treeview_.set_model(treemodel_);
|
treeview_.set_model(treemodel_);
|
||||||
|
|
||||||
//Add the TreeView's view columns:
|
|
||||||
auto cell = Gtk::manage(new Gtk::CellRendererText());
|
auto cell = Gtk::manage(new Gtk::CellRendererText());
|
||||||
int cols_count = treeview_.append_column(
|
int cols_count = treeview_.append_column(
|
||||||
M("DYNPROFILEEDITOR_PROFILE"), *cell);
|
M("DYNPROFILEEDITOR_PROFILE"), *cell);
|
||||||
@ -374,8 +371,13 @@ void DynamicProfilePanel::render_profilepath(
|
|||||||
auto row = *iter; \
|
auto row = *iter; \
|
||||||
Gtk::CellRendererText *ct = static_cast<Gtk::CellRendererText *>(cell); \
|
Gtk::CellRendererText *ct = static_cast<Gtk::CellRendererText *>(cell); \
|
||||||
DynamicProfileEntry::Range<tp> r = row[columns_. name]; \
|
DynamicProfileEntry::Range<tp> r = row[columns_. name]; \
|
||||||
|
DynamicProfileEntry dflt; \
|
||||||
|
if (r.min > dflt.name.min || r.max < dflt.name.max) { \
|
||||||
auto value = to_str(r.min) + " - " + to_str(r.max); \
|
auto value = to_str(r.min) + " - " + to_str(r.max); \
|
||||||
ct->property_text() = value;
|
ct->property_text() = value; \
|
||||||
|
} else { \
|
||||||
|
ct->property_text() = ""; \
|
||||||
|
}
|
||||||
|
|
||||||
void DynamicProfilePanel::render_iso(
|
void DynamicProfilePanel::render_iso(
|
||||||
Gtk::CellRenderer *cell, const Gtk::TreeModel::iterator &iter)
|
Gtk::CellRenderer *cell, const Gtk::TreeModel::iterator &iter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user