[gedit] Reverse the condition for clarity.
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Reverse the condition for clarity.
- Date: Thu, 8 Dec 2011 20:15:19 +0000 (UTC)
commit 8ac71f8e728cbbcc4b01e33919b5663e051b9760
Author: Paolo Borelli <pborelli gnome org>
Date: Thu Dec 8 20:25:13 2011 +0100
Reverse the condition for clarity.
gedit/gedit-notebook.c | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gedit/gedit-notebook.c b/gedit/gedit-notebook.c
index 1f2d9cb..62484f7 100644
--- a/gedit/gedit-notebook.c
+++ b/gedit/gedit-notebook.c
@@ -255,25 +255,25 @@ gedit_notebook_button_press (GtkWidget *widget,
GdkEventButton *event)
{
GtkNotebook *nb = GTK_NOTEBOOK (widget);
- gint tab_clicked;
- if (event->type != GDK_BUTTON_PRESS ||
- event->button != 3 ||
- (event->state & gtk_accelerator_get_default_mod_mask ()) != 0)
+ if (event->type == GDK_BUTTON_PRESS &&
+ event->button == 3 &&
+ (event->state & gtk_accelerator_get_default_mod_mask ()) == 0)
{
- return GTK_WIDGET_CLASS (gedit_notebook_parent_class)->button_press_event (widget, event);
- }
+ gint tab_clicked;
- tab_clicked = find_tab_num_at_pos (nb, event->x_root, event->y_root);
- if (tab_clicked < 0)
- {
- return GTK_WIDGET_CLASS (gedit_notebook_parent_class)->button_press_event (widget, event);
- }
+ tab_clicked = find_tab_num_at_pos (nb, event->x_root, event->y_root);
+ if (tab_clicked >= 0)
+ {
+ /* switch to the page the mouse is over */
+ gtk_notebook_set_current_page (nb, tab_clicked);
- /* switch to the page the mouse is over */
- gtk_notebook_set_current_page (nb, tab_clicked);
+ return TRUE;
+ }
- return TRUE;
+ }
+
+ return GTK_WIDGET_CLASS (gedit_notebook_parent_class)->button_press_event (widget, event);
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]