[Xfce4-commits] <mousepad:master> * mousepad/mousepad-search-bar.c: Fix red entry when toggling the highlight button.
Nick Schermer
noreply at xfce.org
Sat May 5 21:31:04 CEST 2012
- Previous message: [Xfce4-commits] <mousepad:master> * mousepad/mousepad-document.c: Fix column number in statusbar. First column is 0 and not 1. * mousepad/mousepad-dialogs.c: Improve the go to dialog. You can now set the column number too. * mousepad/mousepad-window{.c, -ui.xml}: Improve the menu layout big time. Make mnemonics consistent right now. A couple of name, tooltip and keybindings changes. Internal names make more sense now. * mousepad/mousepad-{window, view}.c Add option to paste from history. The history holds the last 9 history cut/copied items from Mousepad. * mousepad/mousepad-window.c: New from template menu. Works the same as the implementation in Thunar. Menu is generated the first time the file menu is shown. Same for the recent menu. * mousepad/mousepad-{window, view}.c: Add option to toggle between column and normal selections. Put it in View -> Change to Column Selection. To make this work properly I've removed multi selection. Code got much easier and a co uple of complex functions were dropped. * mousepad/mousepad-window{.c, -ui.xml}: Put search menu items in the edit menu, since you will most likely access them from keybindings most of the time. * mousepad/mousepad-window.c: Cleanuped up a lot of functions. * mousepad/mousepad-window.c: Check if files exists when generating the recent menu, remove it when it was not found. Also unref the action after adding it to the action group, fixes an ugly memory leak, since the recent info isn't released eighter. * mousepad/mousepad-util.c: Add faster function to escape underscores in the recent menu. Drop the previous function used for this. * mousepad/mousepad-private.h: Add macros around g_object_(get/set) _qdata and use them instead of the existing g_object_(get/set) _data functions. * mousepad/mousepad-view.c: Fix indent with (shift) tab. * mousepad/mousepad-view.c: Improve line number drawing. Only redraw the line numbers in the expose area and some other cha nges to reduce the amount of redraws and iter calls. * mousepad/mousepad-view.c: Use the IM to type in multi selections, the previous way was deprecated and this fixes a couple of weird issues. * mousepad/mousepad-view.c: Show realtime selection size in column selections. * mousepad/mousepad-{document, view, window}.c: Put selection change in a separate signal to avoid multiple update the the action group. * mousepad/mousepad-view.c: Avoid a lot of statusbar updates and column selection redraws during dragging by comparing the old and new cursor position. On the other hand, the 'only draw the visible area during drag' trick has been partly removed to properly display the selection length during a column draw that covers more then the window height. * mousepad/mousepad-{util, view}.c: Add functions to change the case of a selection. * mousepad/mousepad-view.c: Add function to replace tabs with spaces and vice versa. The replacements are inlined, so you don't see visual changes in the document. Actions are not usable during column selections. * mousepad/mousepad-window.c: Make the arrow buttons in the notebook work. * mousepad/mousepad-window.c: Close document on middle click on the tab, this is a stupid feature, but since everyone requests it on apps with tabs: add it to save a bugzilla report. * mousepad/mousepad-{window, view}.c: Add actions to increase or decrease the indentation of line(s) using the menu or keybindings. * mousepad/mousepad-{window, view}.c: Add an action to duplicate a line or selection. Only work for normal selections or no selection. * mousepad/mousepad-{window, view}.c: Add an action to move the selected lines up and down. Not implemented for column selections (yet). Menu actions are insensitive when there is no regual selection. * mousepad/mousepad-{window, view}.c: Add option to strip trailing spaces and tabs. * mousepad/mousepad-window.c: Add a file to the recent history aft er saving it under another name. * mousepad/mousepad-window{.c, -ui.xml}: Add line ending type in the document menu. * mousepad/mousepad-window.c: Avoid one menu update when adding or removing a new document to the window. * mousepad/mousepad-document.c: Change tab label color when the document is modified or readonly. * ChangeLog: Properly break lines.
- Next message: [Xfce4-commits] <mousepad:master> * mousepad/mousepad-{search-bar, window}.c: Remove highlight when hiding the search bar. Search ahead when opening the search bar.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Updating branch refs/heads/master
to 72415680ea141554b03f505d5f9a96861957c5a0 (commit)
from 562a27b0824e528841b1a58b01d8c9978f4bd05e (commit)
commit 72415680ea141554b03f505d5f9a96861957c5a0
Author: Nick Schermer <nick at xfce.org>
Date: Fri Dec 7 19:42:23 2007 +0000
* mousepad/mousepad-search-bar.c: Fix red entry when toggling the
highlight button.
(Old svn revision: 26447)
ChangeLog | 8 +++++-
mousepad/mousepad-search-bar.c | 58 ++++++++++++++++++++++++++--------------
2 files changed, 45 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3f3b0a1..1ac7eef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-2007-xx-xx Nick Schermer <nick at xfce.org>
+2007-12-07 Nick Schermer <nick at xfce.org>
+
+ * mousepad/mousepad-search-bar.c: Fix red entry when toggling the
+ highlight button.
+
+
+2007-12-06 Nick Schermer <nick at xfce.org>
* mousepad/mousepad-document.c: Fix column number in statusbar.
First column is 0 and not 1.
diff --git a/mousepad/mousepad-search-bar.c b/mousepad/mousepad-search-bar.c
index f2a17a9..4fa61dc 100644
--- a/mousepad/mousepad-search-bar.c
+++ b/mousepad/mousepad-search-bar.c
@@ -322,12 +322,16 @@ mousepad_search_bar_find_string (MousepadSearchBar *bar,
/* emit signal */
g_signal_emit (G_OBJECT (bar), search_bar_signals[SEARCH], 0, flags, string, NULL, &nmatches);
- /* make sure the search entry is not red when no text was typed */
- if (string == NULL || *string == '\0')
- nmatches = 1;
+ /* do nothing with the error entry when highlight when trigged with highlight */
+ if ((flags & MOUSEPAD_SEARCH_FLAGS_ACTION_HIGHTLIGHT) == 0)
+ {
+ /* make sure the search entry is not red when no text was typed */
+ if (string == NULL || *string == '\0')
+ nmatches = 1;
- /* change the entry style */
- mousepad_util_entry_error (bar->entry, nmatches < 1);
+ /* change the entry style */
+ mousepad_util_entry_error (bar->entry, nmatches < 1);
+ }
}
@@ -357,8 +361,7 @@ mousepad_search_bar_entry_changed (GtkWidget *entry,
mousepad_search_bar_find_string (bar, flags);
/* schedule a new highlight */
- if (bar->highlight_all)
- mousepad_search_bar_highlight_schedule (bar);
+ mousepad_search_bar_highlight_schedule (bar);
}
@@ -367,13 +370,31 @@ static void
mousepad_search_bar_highlight_toggled (GtkWidget *button,
MousepadSearchBar *bar)
{
+ MousepadSearchFlags flags;
+
_mousepad_return_if_fail (MOUSEPAD_IS_SEARCH_BAR (bar));
/* set the new state */
bar->highlight_all = gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (button));
- /* reschedule the highlight */
- mousepad_search_bar_highlight_schedule (bar);
+ if (bar->highlight_all)
+ {
+ /* reschedule the highlight */
+ mousepad_search_bar_highlight_schedule (bar);
+ }
+ else
+ {
+ /* stop timeout */
+ if (bar->highlight_id != 0)
+ g_source_remove (bar->highlight_id);
+
+ /* set search flags */
+ flags = MOUSEPAD_SEARCH_FLAGS_ACTION_HIGHTLIGHT
+ | MOUSEPAD_SEARCH_FLAGS_ACTION_CLEANUP;
+
+ /* emit signal to cleanup the highlight */
+ mousepad_search_bar_find_string (bar, flags);
+ }
}
@@ -402,8 +423,7 @@ mousepad_search_bar_match_case_toggled (GtkWidget *button,
mousepad_search_bar_entry_changed (NULL, bar);
/* schedule a new hightlight */
- if (bar->highlight_all)
- mousepad_search_bar_highlight_schedule (bar);
+ mousepad_search_bar_highlight_schedule (bar);
}
@@ -434,8 +454,11 @@ mousepad_search_bar_highlight_schedule (MousepadSearchBar *bar)
g_source_remove (bar->highlight_id);
/* schedule a new timeout */
- bar->highlight_id = g_timeout_add_full (G_PRIORITY_LOW, HIGHTLIGHT_TIMEOUT, mousepad_search_bar_highlight_timeout,
- bar, mousepad_search_bar_highlight_timeout_destroy);
+ if (bar->highlight_all)
+ {
+ bar->highlight_id = g_timeout_add_full (G_PRIORITY_LOW, HIGHTLIGHT_TIMEOUT, mousepad_search_bar_highlight_timeout,
+ bar, mousepad_search_bar_highlight_timeout_destroy);
+ }
}
@@ -461,11 +484,7 @@ mousepad_search_bar_highlight_timeout (gpointer user_data)
| MOUSEPAD_SEARCH_FLAGS_ITER_AREA_START
| MOUSEPAD_SEARCH_FLAGS_ACTION_HIGHTLIGHT;
- /* only clear when there is no text */
- if (!bar->highlight_all)
- flags |= MOUSEPAD_SEARCH_FLAGS_ACTION_CLEANUP;
-
- /* hightlight */
+ /* emit signal */
mousepad_search_bar_find_string (bar, flags);
GDK_THREADS_LEAVE ();
@@ -496,8 +515,7 @@ mousepad_search_bar_focus (MousepadSearchBar *bar)
gtk_widget_grab_focus (bar->entry);
/* update the highlight */
- if (bar->highlight_all)
- mousepad_search_bar_highlight_schedule (bar);
+ mousepad_search_bar_highlight_schedule (bar);
}
- Previous message: [Xfce4-commits] <mousepad:master> * mousepad/mousepad-document.c: Fix column number in statusbar. First column is 0 and not 1. * mousepad/mousepad-dialogs.c: Improve the go to dialog. You can now set the column number too. * mousepad/mousepad-window{.c, -ui.xml}: Improve the menu layout big time. Make mnemonics consistent right now. A couple of name, tooltip and keybindings changes. Internal names make more sense now. * mousepad/mousepad-{window, view}.c Add option to paste from history. The history holds the last 9 history cut/copied items from Mousepad. * mousepad/mousepad-window.c: New from template menu. Works the same as the implementation in Thunar. Menu is generated the first time the file menu is shown. Same for the recent menu. * mousepad/mousepad-{window, view}.c: Add option to toggle between column and normal selections. Put it in View -> Change to Column Selection. To make this work properly I've removed multi selection. Code got much easier and a co uple of complex functions were dropped. * mousepad/mousepad-window{.c, -ui.xml}: Put search menu items in the edit menu, since you will most likely access them from keybindings most of the time. * mousepad/mousepad-window.c: Cleanuped up a lot of functions. * mousepad/mousepad-window.c: Check if files exists when generating the recent menu, remove it when it was not found. Also unref the action after adding it to the action group, fixes an ugly memory leak, since the recent info isn't released eighter. * mousepad/mousepad-util.c: Add faster function to escape underscores in the recent menu. Drop the previous function used for this. * mousepad/mousepad-private.h: Add macros around g_object_(get/set) _qdata and use them instead of the existing g_object_(get/set) _data functions. * mousepad/mousepad-view.c: Fix indent with (shift) tab. * mousepad/mousepad-view.c: Improve line number drawing. Only redraw the line numbers in the expose area and some other cha nges to reduce the amount of redraws and iter calls. * mousepad/mousepad-view.c: Use the IM to type in multi selections, the previous way was deprecated and this fixes a couple of weird issues. * mousepad/mousepad-view.c: Show realtime selection size in column selections. * mousepad/mousepad-{document, view, window}.c: Put selection change in a separate signal to avoid multiple update the the action group. * mousepad/mousepad-view.c: Avoid a lot of statusbar updates and column selection redraws during dragging by comparing the old and new cursor position. On the other hand, the 'only draw the visible area during drag' trick has been partly removed to properly display the selection length during a column draw that covers more then the window height. * mousepad/mousepad-{util, view}.c: Add functions to change the case of a selection. * mousepad/mousepad-view.c: Add function to replace tabs with spaces and vice versa. The replacements are inlined, so you don't see visual changes in the document. Actions are not usable during column selections. * mousepad/mousepad-window.c: Make the arrow buttons in the notebook work. * mousepad/mousepad-window.c: Close document on middle click on the tab, this is a stupid feature, but since everyone requests it on apps with tabs: add it to save a bugzilla report. * mousepad/mousepad-{window, view}.c: Add actions to increase or decrease the indentation of line(s) using the menu or keybindings. * mousepad/mousepad-{window, view}.c: Add an action to duplicate a line or selection. Only work for normal selections or no selection. * mousepad/mousepad-{window, view}.c: Add an action to move the selected lines up and down. Not implemented for column selections (yet). Menu actions are insensitive when there is no regual selection. * mousepad/mousepad-{window, view}.c: Add option to strip trailing spaces and tabs. * mousepad/mousepad-window.c: Add a file to the recent history aft er saving it under another name. * mousepad/mousepad-window{.c, -ui.xml}: Add line ending type in the document menu. * mousepad/mousepad-window.c: Avoid one menu update when adding or removing a new document to the window. * mousepad/mousepad-document.c: Change tab label color when the document is modified or readonly. * ChangeLog: Properly break lines.
- Next message: [Xfce4-commits] <mousepad:master> * mousepad/mousepad-{search-bar, window}.c: Remove highlight when hiding the search bar. Search ahead when opening the search bar.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Xfce4-commits
mailing list