Commit 0cc6974f authored by Grumbel's avatar Grumbel

Have button grab focus, this prevents GtkLabel from getting selected

parent 41879de0
......@@ -101,7 +101,7 @@ JoystickCalibrationWidget::JoystickCalibrationWidget(Joystick& joystick)
add_button(Gtk::Stock::REVERT_TO_SAVED, 2);
add_button("Raw Events", 1);
add_button(Gtk::Stock::CLOSE, 0);
Gtk::Widget* close_button = add_button(Gtk::Stock::CLOSE, 0);
scroll.add(axis_table);
scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
......@@ -112,6 +112,8 @@ JoystickCalibrationWidget::JoystickCalibrationWidget(Joystick& joystick)
signal_response().connect(sigc::mem_fun(this, &JoystickCalibrationWidget::on_response));
close_button->grab_focus();
update_with(joystick.get_calibration());
}
......
......@@ -95,6 +95,8 @@ JoystickListWidget::JoystickListWidget() :
m_properties_button.signal_clicked().connect([this]{ on_properties_button(); });
m_close_button.signal_clicked().connect([this]{ hide(); });
m_close_button.grab_focus();
on_refresh_button();
}
......
......@@ -40,7 +40,7 @@ JoystickMapWidget::JoystickMapWidget(Joystick& joystick)
get_vbox()->pack_start(hbox, Gtk::PACK_EXPAND_WIDGET);
add_button(Gtk::Stock::REVERT_TO_SAVED, 1);
add_button(Gtk::Stock::CLOSE, 0);
Gtk::Widget* close_button = add_button(Gtk::Stock::CLOSE, 0);
const std::vector<int>& button_mapping = joystick.get_button_mapping();
for(std::vector<int>::const_iterator i = button_mapping.begin(); i != button_mapping.end(); ++i)
......@@ -59,6 +59,8 @@ JoystickMapWidget::JoystickMapWidget(Joystick& joystick)
}
signal_response().connect(sigc::mem_fun(this, &JoystickMapWidget::on_response));
close_button->grab_focus();
}
void
......
......@@ -55,11 +55,7 @@ JoystickTestWidget::JoystickTestWidget(JoystickGui& gui, Joystick& joystick_, bo
set_icon_from_file(Main::current()->get_data_directory() + "generic.png");
label.set_use_markup(true);
// FIXME: Gtk3 selects all the text by default, even without user
// interaction, so disable this for now.
//
// label.set_selectable(true);
// label.select_region(-1, -1);
label.set_selectable(true);
axis_frame.set_border_width(5);
axis_table.set_border_width(5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment