DONE: custom color chooser button (after a patch contributed by Alex Ray)
DONE: remember last used directory (after a patch contributed by Lu Zhihe)
DONE: discard Alt-click and Control-click events
-
-(go through Patches tracker and take the good stuff... now at 2009-05-09)
-
-DONE?? option to have buttons *toggle* the tool rather than act as tool
+DONE: option to have buttons *toggle* the tool rather than act as tool
(ie button 2 causes button 1 to map to tool 2) [Dylan Thurston]
+DONE: patch to fix focus + allow up/dn in single page mode (Bob McElrath)
+ also comment out contents of reset_focus() ? (tracker patch #2494022)
+DONE: patch to fix underscores in MRU filename display (Bob McElrath)
+DONE: patch to avoid tiny file dialogs (Bob McElrath)
-** commit patches from Bob McElrath
+(go through Patches tracker and take the good stuff... now at 2009-05-09)
- paper color chooser (see tracker 2083103)
- prerelease: update help file (remove references to pdftoppm/libgnomeprint
& update to poppler/gtkprint)
- REMOVE BINARY INSTALLER (poppler breaks ABI all the time)
+ but add a configure script (+ Makefile.in, etc ?)
- document config options into manual file?
- PDF bg memory usage throttling / delete oldest pdf backgrounds
- replace ttsubset by something more modern? (eg. from cairo ?)
- auto-hide patch from ~/prog/src/xournal-autohide/ ?
(check for cpu usage; handle BOTH edges
and only (un)hide stuff at the correct edge!)
+** remove reset_focus() and calls to it, after enough testing.
+ check if we should call reset_recognizer() in some of those places
+ (e.g., undo/redo?)
** if bg pdf not found in absolute path, look in path of xoj file before
prompting user.
-** patch to fix focus + allow up/dn in single page mode (Bob McElrath)
- also comment out contents of reset_focus() ? (tracker patch #2494022)
-** patch to fix underscores in MRU filename display (McElrath) (tracker)
- (fix memory leak)
** UI update (Bob McElrath) -- eliminating status bar, compact layout,
"compact interface" by default; themes, with line in config file
to load pixmaps from pixmaps/$THEME/ (see Jan 9, 2009 emails)
allow_all_accels();
add_scroll_bindings();
+ // prevent interface items from stealing focus
+ // glade doesn't properly handle can_focus, so manually set it
+ gtk_combo_box_set_focus_on_click(GTK_COMBO_BOX(GET_COMPONENT("comboLayer")), FALSE);
+ g_signal_connect(GET_COMPONENT("spinPageNo"), "activate",
+ G_CALLBACK(handle_activate_signal), NULL);
+ gtk_container_foreach(GTK_CONTAINER(winMain), unset_flags, (gpointer)GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS(GTK_WIDGET(canvas), GTK_CAN_FOCUS);
+ GTK_WIDGET_SET_FLAGS(GTK_WIDGET(GET_COMPONENT("spinPageNo")), GTK_CAN_FOCUS);
+
// set up and initialize the canvas
gtk_widget_show (GTK_WIDGET (canvas));
(gpointer)(gtk_scrolled_window_get_hscrollbar(GTK_SCROLLED_WINDOW(w))),
"event", G_CALLBACK (filter_extended_events),
NULL);
+ }
+ if (!gtk_check_version(2, 17, 0)) {
g_signal_connect (
GET_COMPONENT("comboLayer"),
"notify::popup-shown", G_CALLBACK (combobox_popup_disable_xinput),
dialog = gtk_file_chooser_dialog_new(_("Open PDF"), GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
+#ifdef FILE_DIALOG_SIZE_BUGFIX
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 400);
+#endif
filt_all = gtk_file_filter_new();
gtk_file_filter_set_name(filt_all, _("All files"));
dialog = gtk_file_chooser_dialog_new(_("Open Journal"), GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
+#ifdef FILE_DIALOG_SIZE_BUGFIX
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 400);
+#endif
filt_all = gtk_file_filter_new();
gtk_file_filter_set_name(filt_all, _("All files"));
dialog = gtk_file_chooser_dialog_new(_("Save Journal"), GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK, NULL);
+#ifdef FILE_DIALOG_SIZE_BUGFIX
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 400);
+#endif
if (ui.filename!=NULL) {
gtk_file_chooser_set_filename(GTK_FILE_CHOOSER (dialog), ui.filename);
dialog = gtk_file_chooser_dialog_new(_("Export to PDF"), GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_SAVE, GTK_RESPONSE_OK, NULL);
+#ifdef FILE_DIALOG_SIZE_BUGFIX
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 400);
+#endif
if (ui.filename!=NULL) {
if (g_str_has_suffix(ui.filename, ".xoj")) {
dialog = gtk_file_chooser_dialog_new(_("Open Background"), GTK_WINDOW (winMain),
GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL);
+#ifdef FILE_DIALOG_SIZE_BUGFIX
+ gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 400);
+#endif
filt_all = gtk_file_filter_new();
gtk_file_filter_set_name(filt_all, _("All files"));
GdkEventKey *event,
gpointer user_data)
{
+ GtkAdjustment *adj;
+ gint pgheight;
+
// Esc leaves text edition, or leaves fullscreen mode
if (event->keyval == GDK_Escape) {
- if (ui.cur_item_type == ITEM_TEXT) { end_text(); reset_focus(); }
- else if (ui.fullscreen) do_fullscreen(FALSE);
+ if (ui.cur_item_type == ITEM_TEXT) {
+ end_text();
+ reset_focus();
+ return TRUE;
+ }
+ else if (ui.fullscreen) {
+ do_fullscreen(FALSE);
+ return TRUE;
+ }
+ else return FALSE;
}
- // If zoomed-out and in single page mode, switch pages with PgUp/PgDn.
- if (!ui.view_continuous &&
- (0.96 * ui.zoom * ui.cur_page->height <
- GTK_WIDGET(canvas)->allocation.height)) {
- if (event->keyval == GDK_Page_Down) {
+ /* In single page mode, switch pages with PgUp/PgDn (or Up/Dn)
+ when there's nowhere else to go. */
+ pgheight = GTK_WIDGET(canvas)->allocation.height;
+ adj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(GET_COMPONENT("scrolledwindowMain")));
+
+ if (event->keyval == GDK_Page_Down || event->keyval == GDK_Down) {
+ if (!ui.view_continuous &&
+ (0.96 * ui.zoom * ui.cur_page->height < pgheight ||
+ adj->value == adj->upper-pgheight))
+ {
end_text();
- reset_focus();
- if (ui.pageno == journal.npages-1) { return FALSE; }
- do_switch_page(ui.pageno+1, TRUE, FALSE);
+ if (ui.pageno < journal.npages-1)
+ do_switch_page(ui.pageno+1, TRUE, FALSE);
+ return TRUE;
}
- if (event->keyval == GDK_Page_Up) {
+ if (adj->value == adj->upper-pgheight) return TRUE; // don't send focus away
+ }
+
+ if (event->keyval == GDK_Page_Up || event->keyval == GDK_Up) {
+ if (!ui.view_continuous &&
+ (0.96 * ui.zoom * ui.cur_page->height < pgheight ||
+ adj->value == adj->lower))
+ {
end_text();
- reset_focus();
- if (ui.pageno == 0) { return FALSE; }
- do_switch_page(ui.pageno-1, TRUE, FALSE);
+ if (ui.pageno != 0) {
+ do_switch_page(ui.pageno-1, TRUE, FALSE);
+ gtk_adjustment_set_value(adj, adj->upper-pgheight);
+ }
+ return TRUE;
}
+ if (adj->value == adj->lower) return TRUE; // don't send focus away
}
return FALSE;
for (i=0; i<MRU_SIZE; i++) {
if (ui.mru[i]!=NULL) {
- tmp = g_strdup_printf("_%d %s", i+1, g_basename(ui.mru[i]));
+ tmp = g_strdup_printf("_%d %s", i+1,
+ g_strjoinv("__", g_strsplit_set(g_basename(ui.mru[i]),"_",-1)));
gtk_label_set_text_with_mnemonic(GTK_LABEL(gtk_bin_get_child(GTK_BIN(ui.mrumenu[i]))),
tmp);
g_free(tmp);
// send the focus back to the appropriate widget
void reset_focus(void)
{
+/*
if (ui.cur_item_type == ITEM_TEXT)
gtk_widget_grab_focus(ui.cur_item->widget);
else
gtk_widget_grab_focus(GTK_WIDGET(canvas));
reset_recognizer();
+*/
}
// selection / clipboard stuff
gtk_widget_set_extension_events(GTK_WIDGET (canvas),
(ui.use_xinput && !is_shown)?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE);
}
+
+/* When enter is pressed into page spinbox, send focus back to canvas. */
+
+gboolean handle_activate_signal(GtkWidget *widget, gpointer user_data)
+{
+ gtk_widget_grab_focus(GTK_WIDGET(canvas));
+ return FALSE;
+}
+
+/* recursively unset widget flags */
+
+void unset_flags(GtkWidget *w, gpointer flag)
+{
+ GTK_WIDGET_UNSET_FLAGS(w, (GtkWidgetFlags)flag);
+ if(GTK_IS_CONTAINER(w))
+ gtk_container_foreach(GTK_CONTAINER(w), unset_flags, flag);
+}
+
\ No newline at end of file
// gboolean fix_extended_events(GtkWidget *widget, GdkEvent *event, gpointer user_data);
gboolean combobox_popup_disable_xinput(GtkWidget *widget, GdkEvent *event, gpointer user_data);
-
+// help with focus
+gboolean handle_activate_signal(GtkWidget *widget, gpointer user_data);
+void unset_flags(GtkWidget *w, gpointer flag);
// defines for paper rulings
XInput and want to try things differently. This will probably break
on-the-fly display rotation after application startup, though. */
+#define FILE_DIALOG_SIZE_BUGFIX
+/* ugly, but should help users with versions of GTK+ that suffer from the
+ "tiny file dialog" syndrome, without hurting those with well-behaved
+ versions of GTK+. Comment out if you'd prefer not to include this fix. */
+
// PREF FILES INFO
#define CONFIG_DIR ".xournal"