From f8d8a892206e8258d4b4d368f38f0263f4c3d490 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 29 Oct 2016 18:09:03 +0200 Subject: [PATCH] Inv(#1020): reorganise tooltips and accelerators --- src/gui/panel/timeline-panel.cpp | 40 +++++++++++++++++++++++--------- src/gui/panel/timeline-panel.hpp | 2 ++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/src/gui/panel/timeline-panel.cpp b/src/gui/panel/timeline-panel.cpp index 3193006f0..e74a88647 100644 --- a/src/gui/panel/timeline-panel.cpp +++ b/src/gui/panel/timeline-panel.cpp @@ -81,29 +81,40 @@ namespace panel { buttons_.set_layout(Gtk::BUTTONBOX_START); // buttons to trigger experiments - button_1_.set_label("Experiment _1"); - button_1_.set_tooltip_text("place new child widget\nat random position on the canvas"); + button_1_.set_label("_place"); + button_1_.set_use_underline(); + button_1_.set_tooltip_markup("Experiment 1:\nplace new child widget\nat random position on the canvas"); button_1_.signal_clicked().connect( mem_fun(*this, &TimelinePanel::experiment_1)); buttons_.add(button_1_); - button_2_.set_label("Experiment _2"); - button_2_.set_tooltip_text("move all child widgets randomly"); + button_2_.set_label("_move"); + button_2_.set_use_underline(); + button_2_.set_tooltip_markup("Experiment 2:\nmove all child widgets randomly"); button_2_.signal_clicked().connect( mem_fun(*this, &TimelinePanel::experiment_2)); buttons_.add(button_2_); - button_3_.set_label("Experiment _3"); - button_3_.set_tooltip_text("align all child widgets in a row\nwith silight random vertical offset"); + button_3_.set_label("a_lign"); + button_3_.set_use_underline(); + button_3_.set_tooltip_markup("Experiment 3:\nalign all child widgets in a row\nwith silight random vertical offset"); button_3_.signal_clicked().connect( mem_fun(*this, &TimelinePanel::experiment_3)); buttons_.add(button_3_); - button_4_.set_label("Experiment _4"); - button_4_.set_tooltip_text("kill arbitrary child widget"); + button_4_.set_label("kill"); + button_4_.set_use_underline(); + button_4_.set_tooltip_markup("Experiment 4:\nkill arbitrary child widget"); button_4_.signal_clicked().connect( mem_fun(*this, &TimelinePanel::experiment_4)); buttons_.add(button_4_); + + button_5_.set_label("_kill"); + button_5_.set_use_underline(); + button_5_.set_tooltip_markup("Experiment 5:\nkill arbitrary child widget"); + button_5_.signal_clicked().connect( + mem_fun(*this, &TimelinePanel::experiment_5)); + buttons_.add(button_5_); //(End)buttons... frame_.add(scroller_); @@ -158,7 +169,7 @@ namespace panel { void TimelinePanel::experiment_1() { - frame_.set_label("Experiment 1..."); + frame_.set_label("Experiment 1... PLACE"); ChildEx* chld = makeChld(); childz_.push_back(chld); @@ -173,7 +184,7 @@ namespace panel { void TimelinePanel::experiment_2() { - frame_.set_label("Experiment 2..."); + frame_.set_label("Experiment 2... MOVE"); for (Widget* chld : childz_) { uint x = canvas_.child_property_x(*chld); @@ -192,7 +203,7 @@ namespace panel { void TimelinePanel::experiment_3() { - frame_.set_label("Experiment 3..."); + frame_.set_label("Experiment 3... ALIGN"); uint pos=0; for (Widget* chld : childz_) { @@ -210,6 +221,13 @@ namespace panel { TimelinePanel::experiment_4() { frame_.set_label("Experiment 4..."); + } + + + void + TimelinePanel::experiment_5() + { + frame_.set_label("Experiment 5... KILL"); uint killPos = rand() % childz_.size(); ChildV::iterator killThat(&childz_[killPos]); ChildEx* victim = *killThat; diff --git a/src/gui/panel/timeline-panel.hpp b/src/gui/panel/timeline-panel.hpp index ccabf2271..2a278fe29 100644 --- a/src/gui/panel/timeline-panel.hpp +++ b/src/gui/panel/timeline-panel.hpp @@ -109,6 +109,7 @@ namespace panel { Gtk::Button button_2_; Gtk::Button button_3_; Gtk::Button button_4_; + Gtk::Button button_5_; Gtk::Frame frame_; Gtk::ScrolledWindow scroller_; Gtk::Layout canvas_; @@ -124,6 +125,7 @@ namespace panel { void experiment_2(); void experiment_3(); void experiment_4(); + void experiment_5(); };