Skip to content

Commit

Permalink
add option not to show clicks
Browse files Browse the repository at this point in the history
darcs-hash:20080711224126-a887e-e27969459d74099394cead2000a12aec0d93a79f.gz
  • Loading branch information
thjaeger committed Jul 11, 2008
1 parent 708d8d0 commit bc41365
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion actiondb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Ranking ActionDB::handle(RStroke s) {
}
if (!success && s->trivial()) {
r.id = -1;
r.name = "button press (default)";
r.name = "click (default)";
success = true;
}
if (success) {
Expand Down
20 changes: 18 additions & 2 deletions gui.glade
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.5 on Sat Jul 12 00:32:04 2008 -->
<!--Generated with glade3 3.4.5 on Sat Jul 12 00:33:40 2008 -->
<glade-interface>
<widget class="GtkWindow" id="main">
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
Expand Down Expand Up @@ -614,6 +614,19 @@ None</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="border_width">6</property>
<property name="spacing">6</property>
<child>
<widget class="GtkCheckButton" id="check_show_clicks">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Show clicks</property>
<property name="response_id">0</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHPaned" id="hpaned1">
<property name="visible">True</property>
Expand Down Expand Up @@ -658,6 +671,9 @@ None</property>
</packing>
</child>
</widget>
<packing>
<property name="position">1</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox2">
Expand Down Expand Up @@ -696,7 +712,7 @@ None</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
</widget>
Expand Down
3 changes: 2 additions & 1 deletion main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ void handle_stroke(RStroke s, int trigger, int button) {
Ranking ranking = actions().handle(s);
if (ranking.id == -1)
press_button = trigger;
win->stroke_push(ranking);
if (ranking.id != -1 || prefs().show_clicks.get())
win->stroke_push(ranking);
}
win->icon_push(s);
} else {
Expand Down
3 changes: 2 additions & 1 deletion prefdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ PrefDB::PrefDB() :
advanced_ignore(false),
radius(pref_radius_default),
ignore_grab(false),
timing_workaround(false)
timing_workaround(false),
show_clicks(true)
{}

bool PrefDB::write() const {
Expand Down
2 changes: 2 additions & 0 deletions prefdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class PrefDB {
if (version <= 3) return;
{ Ref<bool> ref(ignore_grab); ar & *ref; }
{ Ref<bool> ref(timing_workaround); ar & *ref; }
{ Ref<bool> ref(show_clicks); ar & *ref; }
}
std::string filename;
public:
Expand All @@ -72,6 +73,7 @@ class PrefDB {
Lock<int> radius;
Lock<bool> ignore_grab;
Lock<bool> timing_workaround;
Lock<bool> show_clicks;

void read();
bool write() const;
Expand Down
3 changes: 2 additions & 1 deletion prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ Prefs::Prefs() :
q(sigc::mem_fun(*this, &Prefs::on_selected)),
advanced_ignore("check_advanced_ignore", prefs().advanced_ignore),
ignore_grab("check_ignore_grab", prefs().ignore_grab),
timing_workaround("check_timing_workaround", prefs().timing_workaround)
timing_workaround("check_timing_workaround", prefs().timing_workaround),
show_clicks("check_show_clicks", prefs().show_clicks)
{
Gtk::Button *bbutton, *add_exception, *remove_exception, *button_default_p, *button_default_radius;
widgets->get_widget("button_add_exception", add_exception);
Expand Down
2 changes: 1 addition & 1 deletion prefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class Prefs {
Gtk::HScale* scale_p;
Gtk::SpinButton *spin_radius;
Gtk::Label* blabel;
Check advanced_ignore, ignore_grab, timing_workaround;
Check advanced_ignore, ignore_grab, timing_workaround, show_clicks;
};

#endif

0 comments on commit bc41365

Please sign in to comment.