commit 16b22a2b765ededd0b1d628dd6d8c3b54b0375e6
parent 1e8e75144f47a4dbbcbfbaafb07efe22983c690a
Author: Oliver Lowe <o@olowe.co>
Date: Sun, 31 Aug 2025 14:09:03 +1000
Drop single window, wide layout modes
Diffstat:
6 files changed, 71 insertions(+), 356 deletions(-)
diff --git a/src/compose.c b/src/compose.c
@@ -75,7 +75,6 @@
#include "filesel.h"
#include "procheader.h"
#include "procmime.h"
-#include "statusbar.h"
#include "quoted-printable.h"
#include "codeconv.h"
#include "utils.h"
diff --git a/src/folderview.c b/src/folderview.c
@@ -878,8 +878,7 @@ static void folderview_select_node(FolderView *folderview, GtkCMCTreeNode *node)
gtk_cmctree_select(ctree, node);
gtk_cmclist_thaw(GTK_CMCLIST(ctree));
if ((folderview->summaryview->folder_item &&
- folderview->summaryview->folder_item->total_msgs > 0) ||
- prefs_common.layout_mode == SMALL_LAYOUT)
+ folderview->summaryview->folder_item->total_msgs > 0))
summary_select_node(folderview->summaryview,
folderview->summaryview->selected, OPEN_SELECTED_ON_FOLDER_OPEN);
else
diff --git a/src/gtk/quicksearch.c b/src/gtk/quicksearch.c
@@ -75,7 +75,7 @@ struct _QuickSearch
GList *normal_search_strings;
GList *extended_search_strings;
-
+
AdvancedSearch *asearch;
gboolean want_reexec;
gboolean want_history;
@@ -188,7 +188,7 @@ static void quicksearch_invoke_execute(QuickSearch *quicksearch, gboolean run_on
}
do {
- gboolean active = quicksearch->request.matchstring != NULL
+ gboolean active = quicksearch->request.matchstring != NULL
&& g_strcmp0(quicksearch->request.matchstring, "");
advsearch_set(quicksearch->asearch, quicksearch->request.type,
quicksearch->request.matchstring);
@@ -254,10 +254,10 @@ static void quicksearch_set_popdown_strings(QuickSearch *quicksearch)
{
GtkWidget *search_string_entry = quicksearch->search_string_entry;
- combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry));
+ combobox_unset_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry));
if (prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED)
combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
- quicksearch->extended_search_strings);
+ quicksearch->extended_search_strings);
else
combobox_set_popdown_strings(GTK_COMBO_BOX_TEXT(search_string_entry),
quicksearch->normal_search_strings);
@@ -366,7 +366,7 @@ static gboolean searchbar_pressed(GtkWidget *widget, GdkEventKey *event,
/* If the string entry is empty -> hide quicksearch bar. If not -> empty it */
if (!*str) {
summaryview_activate_quicksearch(
- mainwindow_get_mainwindow()->summaryview,
+ mainwindow_get_mainwindow()->summaryview,
FALSE);
} else {
quicksearch_set(quicksearch, prefs_common.summary_quicksearch_type, "");
@@ -517,7 +517,7 @@ static gboolean search_condition_expr(GtkMenuItem *widget, gpointer data)
{
gchar * cond_str;
MatcherList * matchers = NULL;
-
+
cm_return_val_if_fail(
mainwindow_get_mainwindow()->summaryview->quicksearch != NULL,
FALSE);
@@ -551,19 +551,19 @@ static void quicksearch_set_button(GtkButton *button, const gchar *icon, const g
GtkWidget *box;
gboolean icon_visible;
- g_object_get(gtk_settings_get_default(),
- "gtk-button-images", &icon_visible,
+ g_object_get(gtk_settings_get_default(),
+ "gtk-button-images", &icon_visible,
NULL);
for (cur = children; cur; cur = cur->next)
gtk_container_remove(GTK_CONTAINER(button), GTK_WIDGET(cur->data));
-
+
g_list_free(children);
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-
+
gtk_container_add(GTK_CONTAINER(button), box);
if (icon_visible || !text || !*text || icon != NULL)
- gtk_box_pack_start(GTK_BOX(box), gtk_image_new_from_icon_name(icon,
+ gtk_box_pack_start(GTK_BOX(box), gtk_image_new_from_icon_name(icon,
GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(box), gtk_label_new_with_mnemonic(text), FALSE, FALSE, 0);
gtk_widget_show_all(box);
@@ -998,7 +998,7 @@ QuickSearch *quicksearch_new()
_("_Information"));
quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), NULL, _("E_dit"));
quicksearch_set_button(GTK_BUTTON(quicksearch->clear_search), "edit-clear-symbolic", _("C_lear"));
-
+
update_extended_buttons(quicksearch);
GTKUT_GDKRGBA_TO_GDKCOLOR(prefs_common.color[COL_QS_ACTIVE_BG],
@@ -1022,14 +1022,11 @@ void quicksearch_relayout(QuickSearch *quicksearch)
{
switch (prefs_common.layout_mode) {
case NORMAL_LAYOUT:
- case WIDE_LAYOUT:
- case WIDE_MSGLIST_LAYOUT:
quicksearch_set_button(GTK_BUTTON(quicksearch->search_description),
"dialog-information-symbolic", _("_Information"));
quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), NULL, _("E_dit"));
quicksearch_set_button(GTK_BUTTON(quicksearch->clear_search), "edit-clear-symbolic", _("C_lear"));
break;
- case SMALL_LAYOUT:
case VERTICAL_LAYOUT:
quicksearch_set_button(GTK_BUTTON(quicksearch->search_description), "dialog-information-symbolic", "");
quicksearch_set_button(GTK_BUTTON(quicksearch->search_condition_expression), NULL, _("E_dit"));
@@ -1059,7 +1056,7 @@ void quicksearch_show(QuickSearch *quicksearch)
if (!mainwin || !mainwin->summaryview) {
return;
}
-
+
active_type = prefs_common_get_prefs()->summary_quicksearch_type;
quicksearch_set_type(quicksearch, active_type);
}
@@ -1095,7 +1092,7 @@ void quicksearch_set(QuickSearch *quicksearch, AdvancedSearchType type, const gc
quicksearch->in_typing = FALSE;
quicksearch_set_matchstring(quicksearch, matchstring);
-
+
g_signal_handlers_block_by_func(G_OBJECT(gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry)))),
G_CALLBACK(searchbar_changed_cb), quicksearch);
gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN((quicksearch->search_string_entry)))),
@@ -1119,7 +1116,7 @@ static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active)
quicksearch->active = active;
- if (active &&
+ if (active &&
(prefs_common.summary_quicksearch_type == ADVANCED_SEARCH_EXTENDED
&& !advsearch_has_proper_predicate(quicksearch->asearch)))
error = TRUE;
@@ -1178,7 +1175,7 @@ void quicksearch_set_search_strings(QuickSearch *quicksearch)
return;
matcher_parser_disable_warnings(TRUE);
-
+
do {
newstr = advsearch_expand_search_string((gchar *) strings->data);
if (newstr && newstr[0] != '\0') {
@@ -1189,7 +1186,7 @@ void quicksearch_set_search_strings(QuickSearch *quicksearch)
g_strdup(strings->data));
} else {
matcher_list = matcher_parser_get_cond(newstr, FALSE);
-
+
if (matcher_list) {
quicksearch->extended_search_strings =
g_list_prepend(
@@ -1204,10 +1201,10 @@ void quicksearch_set_search_strings(QuickSearch *quicksearch)
}
}
g_free(newstr);
-
+
} while ((strings = g_list_next(strings)) != NULL);
- matcher_parser_disable_warnings(FALSE);
+ matcher_parser_disable_warnings(FALSE);
quicksearch->normal_search_strings = g_list_reverse(quicksearch->normal_search_strings);
quicksearch->extended_search_strings = g_list_reverse(quicksearch->extended_search_strings);
diff --git a/src/mainwindow.c b/src/mainwindow.c
@@ -705,9 +705,6 @@ static GtkRadioActionEntry mainwin_showhide_radio_entries[] = { /* toggle_toolba
static GtkRadioActionEntry mainwin_layout_radio_entries[] = { /* set_layout_cb */
{"View/Layout/Standard", NULL, N_("_Standard"), NULL, NULL, NORMAL_LAYOUT }, /* radio NORMAL_LAYOUT */
{"View/Layout/ThreeColumns", NULL, N_("_Three columns"), NULL, NULL, VERTICAL_LAYOUT }, /* radio VERTICAL_LAYOUT */
- {"View/Layout/WideMessage", NULL, N_("_Wide message"), NULL, NULL, WIDE_LAYOUT }, /* radio WIDE_LAYOUT */
- {"View/Layout/WideMessageList", NULL, N_("W_ide message list"), NULL, NULL, WIDE_MSGLIST_LAYOUT }, /* radio WIDE_MSGLIST_LAYOUT */
- {"View/Layout/SmallScreen", NULL, N_("S_mall screen"), NULL, NULL, SMALL_LAYOUT }, /* radio SMALL_LAYOUT */
};
static GtkRadioActionEntry mainwin_sort_radio_entries[] = { /* sort_summary_cb */
@@ -1050,9 +1047,6 @@ MainWindow *main_window_create()
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Layout", "View/Layout", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "Standard", "View/Layout/Standard", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "ThreeColumns", "View/Layout/ThreeColumns", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "WideMessage", "View/Layout/WideMessage", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "WideMessageList", "View/Layout/WideMessageList", GTK_UI_MANAGER_MENUITEM)
- MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Layout", "SmallScreen", "View/Layout/SmallScreen", GTK_UI_MANAGER_MENUITEM)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Separator2", "View/---", GTK_UI_MANAGER_SEPARATOR)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View", "Sort", "View/Sort", GTK_UI_MANAGER_MENU)
MENUITEM_ADDUI_MANAGER(mainwin->ui_manager, "/Menu/View/Sort", "Number", "View/Sort/Number", GTK_UI_MANAGER_MENUITEM)
@@ -1539,8 +1533,7 @@ MainWindow *main_window_create()
G_CALLBACK(mainwindow_visibility_event_cb), mainwin);
gtk_widget_add_events(GTK_WIDGET(window), GDK_VISIBILITY_NOTIFY_MASK);
- if (prefs_common.layout_mode == VERTICAL_LAYOUT ||
- prefs_common.layout_mode == SMALL_LAYOUT) {
+ if (prefs_common.layout_mode == VERTICAL_LAYOUT) {
summary_relayout(mainwin->summaryview);
}
summary_update_unread(mainwin->summaryview, NULL);
@@ -1698,13 +1691,6 @@ static gboolean reflect_prefs_timeout_cb(gpointer data)
textview_reflect_prefs(mainwin->messageview->mimeview->textview);
summary_redisplay_msg(mainwin->summaryview);
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- if (mainwin->in_folder) {
- mainwindow_enter_folder(mainwin);
- } else {
- mainwindow_exit_folder(mainwin);
- }
- }
}
prefs_tag = 0;
return FALSE;
@@ -1991,34 +1977,6 @@ GTK_EVENTS_FLUSH();
gtk_paned_set_position(GTK_PANED(paned), mid);
}
-static void mainwin_paned_show_first(GtkPaned *paned)
-{
- gint max;
- g_object_get (G_OBJECT(paned),
- "max-position",
- &max, NULL);
-
- if (gtk_paned_get_child1(GTK_PANED(paned)))
- gtk_widget_show(gtk_paned_get_child1(GTK_PANED(paned)));
- if (gtk_paned_get_child2(GTK_PANED(paned)))
- gtk_widget_hide(gtk_paned_get_child2(GTK_PANED(paned)));
- gtk_paned_set_position(GTK_PANED(paned), max);
-}
-
-static void mainwin_paned_show_last(GtkPaned *paned)
-{
- gint min;
- g_object_get (G_OBJECT(paned),
- "min-position",
- &min, NULL);
-
- if (gtk_paned_get_child1(GTK_PANED(paned)))
- gtk_widget_hide(gtk_paned_get_child1(GTK_PANED(paned)));
- if (gtk_paned_get_child2(GTK_PANED(paned)))
- gtk_widget_show(gtk_paned_get_child2(GTK_PANED(paned)));
- gtk_paned_set_position(GTK_PANED(paned), min);
-}
-
void main_window_toggle_message_view(MainWindow *mainwin)
{
SummaryView *summaryview = mainwin->summaryview;
@@ -2028,7 +1986,6 @@ void main_window_toggle_message_view(MainWindow *mainwin)
switch (prefs_common.layout_mode) {
case NORMAL_LAYOUT:
case VERTICAL_LAYOUT:
- case SMALL_LAYOUT:
ppaned = mainwin->vpaned;
container = mainwin->hpaned;
if (gtk_widget_get_parent(ppaned) != NULL) {
@@ -2046,22 +2003,6 @@ void main_window_toggle_message_view(MainWindow *mainwin)
g_object_unref(ppaned);
}
break;
- case WIDE_LAYOUT:
- container = mainwin->vpaned;
- if (gtk_widget_get_parent(mainwin->messageview->vbox) != NULL) {
- mainwin->messageview->visible = FALSE;
- summaryview->displayed = NULL;
- g_object_ref(mainwin->messageview->vbox);
- gtk_container_remove(GTK_CONTAINER(container), mainwin->messageview->vbox);
- } else {
- mainwin->messageview->visible = TRUE;
- gtk_container_add(GTK_CONTAINER(container), mainwin->messageview->vbox);
- g_object_unref(mainwin->messageview->vbox);
- }
- break;
- case WIDE_MSGLIST_LAYOUT:
- g_warning("can't hide messageview in this wide msglist layout");
- break;
}
if (messageview_is_visible(mainwin->messageview))
@@ -2357,7 +2298,7 @@ SensitiveCondMask main_window_get_current_state(MainWindow *mainwin)
if (summary_is_list(mainwin->summaryview))
UPDATE_STATE(M_SUMMARY_ISLIST);
- if (prefs_common.layout_mode != SMALL_LAYOUT || mainwin->in_folder)
+ if (mainwin->in_folder)
UPDATE_STATE(M_IN_MSGLIST);
for (account_list = account_get_list(); account_list != NULL; account_list = account_list->next) {
@@ -2862,14 +2803,6 @@ void main_window_popup(MainWindow *mainwin)
} else {
gtkut_window_popup(mainwin->window);
}
-
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- if (mainwin->in_folder) {
- mainwindow_enter_folder(mainwin);
- } else {
- mainwindow_exit_folder(mainwin);
- }
- }
fix_folderview_scroll(mainwin);
}
@@ -2898,7 +2831,6 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
GtkWidget *hpaned;
GtkWidget *vpaned;
GtkWidget *vbox_body = mainwin->vbox_body;
- gboolean first_set = (mainwin->hpaned == NULL);
debug_print("Setting widgets...\n");
mainwin->messageview->statusbar = mainwin->statusbar;
@@ -2911,12 +2843,10 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
gtk_widget_destroy(mainwin->hpaned);
}
- cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView",
- (layout_mode != WIDE_MSGLIST_LAYOUT && layout_mode != SMALL_LAYOUT));
+ cm_menu_set_sensitive_full(mainwin->ui_manager, "Menu/View/ShowHide/MessageView", TRUE);
switch (layout_mode) {
case VERTICAL_LAYOUT:
case NORMAL_LAYOUT:
- case SMALL_LAYOUT:
hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
if (layout_mode == VERTICAL_LAYOUT)
vpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
@@ -2939,9 +2869,6 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
gtk_paned_add2(GTK_PANED(vpaned),
GTK_WIDGET_PTR(mainwin->messageview));
gtk_widget_show(vpaned);
- if (layout_mode == SMALL_LAYOUT && first_set) {
- mainwin_paned_show_first(GTK_PANED(hpaned));
- }
gtk_paned_set_position(GTK_PANED(hpaned),
prefs_common_get_prefs()->folderview_width);
@@ -2958,63 +2885,6 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
}
break;
- case WIDE_LAYOUT:
- vpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
- hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
- gtk_paned_add1(GTK_PANED(vpaned), hpaned);
-
- gtk_paned_add1(GTK_PANED(hpaned),
- GTK_WIDGET_PTR(mainwin->folderview));
- gtk_paned_add2(GTK_PANED(hpaned),
- GTK_WIDGET_PTR(mainwin->summaryview));
-
- gtk_widget_show(hpaned);
-
- if (messageview_is_visible(mainwin->messageview)) {
- gtk_paned_add2(GTK_PANED(vpaned),
- GTK_WIDGET_PTR(mainwin->messageview));
- } else {
- g_object_ref(GTK_WIDGET_PTR(mainwin->messageview));
- }
- gtk_widget_show(vpaned);
-
- gtk_paned_set_position(GTK_PANED(hpaned),
- prefs_common_get_prefs()->folderview_width);
-
- if (messageview_is_visible(mainwin->messageview)) {
- gtk_paned_set_position(GTK_PANED(vpaned),
- prefs_common_get_prefs()->summaryview_height);
- }
-
- break;
- case WIDE_MSGLIST_LAYOUT:
- vpaned = gtk_paned_new(GTK_ORIENTATION_VERTICAL);
- hpaned = gtk_paned_new(GTK_ORIENTATION_HORIZONTAL);
- gtk_box_pack_start(GTK_BOX(vbox_body), vpaned, TRUE, TRUE, 0);
-
- gtk_paned_add1(GTK_PANED(vpaned),
- GTK_WIDGET_PTR(mainwin->summaryview));
- gtk_paned_add1(GTK_PANED(hpaned),
- GTK_WIDGET_PTR(mainwin->folderview));
-
- gtk_widget_show(hpaned);
-
- if (messageview_is_visible(mainwin->messageview)) {
- gtk_paned_add2(GTK_PANED(hpaned),
- GTK_WIDGET_PTR(mainwin->messageview));
- } else {
- g_object_ref(GTK_WIDGET_PTR(mainwin->messageview));
- }
- gtk_paned_add2(GTK_PANED(vpaned), hpaned);
- gtk_widget_show(vpaned);
-
- gtk_paned_set_position(GTK_PANED(hpaned),
- prefs_common_get_prefs()->folderview_width);
- gtk_paned_set_position(GTK_PANED(vpaned),
- prefs_common_get_prefs()->summaryview_height);
-
- break;
default:
g_warning("unknown layout");
return;
@@ -3023,22 +2893,9 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
mainwin->hpaned = hpaned;
mainwin->vpaned = vpaned;
- if (layout_mode == SMALL_LAYOUT) {
- if (mainwin->messageview->visible)
- main_window_toggle_message_view(mainwin);
- }
-
- if (layout_mode == SMALL_LAYOUT && first_set) {
- gtk_widget_realize(mainwin->window);
- gtk_widget_realize(mainwin->folderview->ctree);
- gtk_widget_realize(mainwin->summaryview->hbox);
- gtk_widget_realize(mainwin->summaryview->hbox_l);
- gtk_paned_set_position(GTK_PANED(mainwin->hpaned), 800);
- } else {
- gtk_window_set_default_size(GTK_WINDOW(mainwin->window),
- prefs_common.mainwin_width,
- prefs_common.mainwin_height);
- }
+ gtk_window_set_default_size(GTK_WINDOW(mainwin->window),
+ prefs_common.mainwin_width,
+ prefs_common.mainwin_height);
if (mainwin->messageview->visible)
gtk_image_set_from_icon_name(GTK_IMAGE(mainwin->summaryview->toggle_arrow),
@@ -3074,15 +2931,6 @@ static void main_window_set_widgets(MainWindow *mainwin, LayoutType layout_mode)
case VERTICAL_LAYOUT:
cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/ThreeColumns", TRUE);
break;
- case WIDE_LAYOUT:
- cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/WideMessage", TRUE);
- break;
- case WIDE_MSGLIST_LAYOUT:
- cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/WideMessageList", TRUE);
- break;
- case SMALL_LAYOUT:
- cm_toggle_menu_set_active_full(mainwin->ui_manager, "Menu/View/Layout/SmallScreen", TRUE);
- break;
}
if (folderwin) {
@@ -3381,7 +3229,6 @@ static void set_layout_cb(GtkAction *action, GtkRadioAction *current, gpointer d
MainWindow *mainwin = (MainWindow *)data;
gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current));
LayoutType layout_mode = value;
- LayoutType old_layout_mode = prefs_common.layout_mode;
if (mainwin->menu_lock_count) {
return;
}
@@ -3393,22 +3240,11 @@ static void set_layout_cb(GtkAction *action, GtkRadioAction *current, gpointer d
return;
}
- if (!mainwin->messageview->visible && layout_mode != SMALL_LAYOUT)
- main_window_toggle_message_view(mainwin);
- else if (mainwin->messageview->visible && layout_mode == SMALL_LAYOUT)
+ if (!mainwin->messageview->visible)
main_window_toggle_message_view(mainwin);
main_window_separation_change(mainwin, layout_mode);
mainwindow_reset_paned(GTK_PANED(mainwin->vpaned));
- if (old_layout_mode == SMALL_LAYOUT && layout_mode != SMALL_LAYOUT) {
- mainwindow_reset_paned(GTK_PANED(mainwin->hpaned));
- if (layout_mode == VERTICAL_LAYOUT)
- mainwindow_reset_paned(GTK_PANED(mainwin->vpaned));
- }
- if (old_layout_mode != SMALL_LAYOUT && layout_mode == SMALL_LAYOUT) {
- mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
- mainwindow_exit_folder(mainwin);
- }
summary_relayout(mainwin->summaryview);
summary_update_unread(mainwin->summaryview, NULL);
}
@@ -4451,19 +4287,11 @@ void mainwindow_jump_to(const gchar *target, gboolean popup)
}
void mainwindow_exit_folder(MainWindow *mainwin) {
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- folderview_close_opened(mainwin->folderview, FALSE);
- mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
- folderview_grab_focus(mainwin->folderview);
- }
mainwin->in_folder = FALSE;
main_window_set_menu_sensitive(mainwin);
}
void mainwindow_enter_folder(MainWindow *mainwin) {
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- mainwin_paned_show_last(GTK_PANED(mainwin->hpaned));
- }
mainwin->in_folder = TRUE;
main_window_set_menu_sensitive(mainwin);
}
diff --git a/src/mainwindow.h b/src/mainwindow.h
@@ -81,9 +81,6 @@ typedef enum
{
NORMAL_LAYOUT = 0,
VERTICAL_LAYOUT = 1 << 0,
- WIDE_LAYOUT = 1 << 1,
- WIDE_MSGLIST_LAYOUT = 1 << 2,
- SMALL_LAYOUT
} LayoutType;
typedef enum
diff --git a/src/summaryview.c b/src/summaryview.c
@@ -720,11 +720,6 @@ SummaryView *summary_create(MainWindow *mainwin)
quicksearch_show(quicksearch);
else
quicksearch_hide(quicksearch);
-
- if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT ||
- prefs_common.layout_mode == SMALL_LAYOUT)
- gtk_widget_hide(summaryview->toggle_eventbox);
-
return summaryview;
}
@@ -742,36 +737,23 @@ void summary_relayout(SummaryView *summaryview)
switch (prefs_common.layout_mode) {
case NORMAL_LAYOUT:
- case WIDE_LAYOUT:
- case WIDE_MSGLIST_LAYOUT:
gtk_box_pack_start(GTK_BOX(summaryview->stat_box),
summaryview->hbox_l, TRUE, TRUE, 0);
gtk_box_pack_end(GTK_BOX(summaryview->stat_box),
summaryview->statlabel_msgs, FALSE, FALSE, HSPACING_NARROW);
gtk_widget_show_all(summaryview->stat_box);
gtk_widget_show_all(summaryview->stat_box2);
- if (prefs_common.layout_mode == WIDE_MSGLIST_LAYOUT ||
- prefs_common.layout_mode == SMALL_LAYOUT)
- gtk_widget_hide(summaryview->toggle_eventbox);
- else
- gtk_widget_show(summaryview->toggle_eventbox);
+ gtk_widget_show(summaryview->toggle_eventbox);
break;
case VERTICAL_LAYOUT:
- case SMALL_LAYOUT:
gtk_box_pack_start(GTK_BOX(summaryview->stat_box),
summaryview->hbox_l, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(summaryview->stat_box2),
summaryview->statlabel_msgs, FALSE, FALSE, HSPACING_NARROW);
gtk_widget_show_all(summaryview->stat_box);
gtk_widget_show_all(summaryview->stat_box2);
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- gtk_widget_hide(summaryview->toggle_eventbox);
- gtk_widget_hide(summaryview->statlabel_msgs);
- } else {
- gtk_widget_show(summaryview->toggle_eventbox);
- gtk_widget_show(summaryview->statlabel_msgs);
- }
-
+ gtk_widget_show(summaryview->toggle_eventbox);
+ gtk_widget_show(summaryview->statlabel_msgs);
break;
}
summary_set_column_order(summaryview);
@@ -869,7 +851,7 @@ static void summary_switch_from_to(SummaryView *summaryview, FolderItem *item)
SummaryColumnState *col_state = summaryview->col_state;
GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
- if (!item || ((prefs_common.layout_mode == VERTICAL_LAYOUT || prefs_common.layout_mode == SMALL_LAYOUT) && prefs_common.two_line_vert) )
+ if (!item || ((prefs_common.layout_mode == VERTICAL_LAYOUT) && prefs_common.two_line_vert) )
return;
if (FOLDER_SHOWS_TO_HDR(item))
show_to = TRUE;
@@ -1105,12 +1087,6 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item, gboolean avoid
if (!is_refresh) {
main_create_mailing_list_menu (summaryview->mainwin, NULL);
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- if (item) {
- mainwindow_enter_folder(summaryview->mainwin);
- gtk_widget_grab_focus(summaryview->ctree);
- }
- }
}
if (!prefs_common.summary_quicksearch_sticky
&& (!prefs_common.summary_quicksearch_recurse
@@ -2499,44 +2475,22 @@ static void summary_status_show(SummaryView *summaryview)
itstr = g_strdup("");
}
- if (prefs_common.layout_mode != SMALL_LAYOUT) {
- str = g_strconcat(n_selected ? itos(n_selected) : "",
- itstr, sel, spc, del, mv, cp, NULL);
- g_free(sel);
- g_free(del);
- g_free(mv);
- g_free(cp);
- g_free(itstr);
+ str = g_strconcat(n_selected ? itos(n_selected) : "",
+ itstr, sel, spc, del, mv, cp, NULL);
+ g_free(sel);
+ g_free(del);
+ g_free(mv);
+ g_free(cp);
+ g_free(itstr);
- gtk_label_set_text(GTK_LABEL(summaryview->statlabel_select), str);
- g_free(str);
+ gtk_label_set_text(GTK_LABEL(summaryview->statlabel_select), str);
+ g_free(str);
- str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
- n_new, n_unread, n_total,
- to_human_readable((goffset)n_size));
- gtk_label_set_text(GTK_LABEL(summaryview->statlabel_msgs), str);
- g_free(str);
- } else {
- gchar *ssize, *tsize;
- if (n_selected) {
- ssize = g_strdup(to_human_readable((goffset)sel_size));
- tsize = g_strdup(to_human_readable((goffset)n_size));
- str = g_strdup_printf(_("%d/%d selected (%s/%s), %d unread"),
- n_selected, n_total, ssize, tsize, n_unread);
- g_free(ssize);
- g_free(tsize);
- } else
- str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
- n_new, n_unread, n_total, to_human_readable((goffset)n_size));
- g_free(sel);
- g_free(del);
- g_free(mv);
- g_free(cp);
- g_free(itstr);
-
- gtk_label_set_text(GTK_LABEL(summaryview->statlabel_select), str);
- g_free(str);
- }
+ str = g_strdup_printf(_("%d new, %d unread, %d total (%s)"),
+ n_new, n_unread, n_total,
+ to_human_readable((goffset)n_size));
+ gtk_label_set_text(GTK_LABEL(summaryview->statlabel_msgs), str);
+ g_free(str);
summary_set_menu_sensitive(summaryview);
toolbar_main_set_sensitive(summaryview->mainwin);
@@ -2831,7 +2785,6 @@ static gboolean summary_insert_gnode_func(GtkCMCTree *ctree, guint depth, GNode
const gchar *msgid = msginfo->msgid;
GHashTable *msgid_table = summaryview->msgid_table;
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
- gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
summary_set_header(summaryview, text, msginfo);
@@ -2857,7 +2810,7 @@ static gboolean summary_insert_gnode_func(GtkCMCTree *ctree, guint depth, GNode
if (summaryview->col_state[summaryview->col_pos[S_COL_TAGS]].visible)
SET_TEXT(S_COL_TAGS);
- if ((vert_layout || small_layout) && prefs_common.two_line_vert)
+ if (vert_layout && prefs_common.two_line_vert)
g_free(text[summaryview->col_pos[S_COL_SUBJECT]]);
#undef SET_TEXT
@@ -2883,7 +2836,6 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
GdkDisplay *display;
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
- gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
if (!mlist) return;
@@ -2941,7 +2893,7 @@ static void summary_set_ctree_from_list(SummaryView *summaryview,
(ctree, NULL, node, text, 2,
NULL, NULL,
FALSE, FALSE);
- if ((vert_layout || small_layout) && prefs_common.two_line_vert)
+ if (vert_layout && prefs_common.two_line_vert)
g_free(text[summaryview->col_pos[S_COL_SUBJECT]]);
GTKUT_CTREE_NODE_SET_ROW_DATA(node, msginfo);
@@ -3037,7 +2989,6 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
gchar *from_text = NULL, *to_text = NULL;
gboolean should_swap = FALSE;
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
- gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
static const gchar *color_dim_rgb = NULL;
if (!color_dim_rgb)
color_dim_rgb = gtkut_gdk_rgba_to_string(&summaryview->color_dim);
@@ -3068,7 +3019,7 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
/* slow! */
if (summaryview->col_state[summaryview->col_pos[S_COL_DATE]].visible ||
- ((vert_layout || small_layout) && prefs_common.two_line_vert)) {
+ (vert_layout && prefs_common.two_line_vert)) {
if (msginfo->date_t && msginfo->date_t > 0) {
procheader_date_get_localtime(date_modified,
sizeof(date_modified),
@@ -3178,7 +3129,7 @@ static inline void summary_set_header(SummaryView *summaryview, gchar *text[],
else
text[col_pos[S_COL_SUBJECT]] = msginfo->subject ? msginfo->subject :
_("(No Subject)");
- if ((vert_layout || small_layout) && prefs_common.two_line_vert) {
+ if (vert_layout && prefs_common.two_line_vert) {
if (!FOLDER_SHOWS_TO_HDR(summaryview->folder_item)) {
gchar *tmp = g_markup_printf_escaped(g_strconcat("%s\n",
"<span color='%s' style='italic'>",
@@ -3371,40 +3322,22 @@ static void summary_display_msg_full(SummaryView *summaryview,
return;
}
- if (new_window && prefs_common.layout_mode != SMALL_LAYOUT) {
- MessageView *msgview;
-
- msgview = messageview_create_with_new_window(summaryview->mainwin);
+ if (new_window) {
+ MessageView *msgview = messageview_create_with_new_window(summaryview->mainwin);
val = messageview_show(msgview, msginfo, all_headers);
} else {
- MessageView *msgview;
-
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- if (summaryview->ext_messageview == NULL)
- summaryview->ext_messageview = messageview_create_with_new_window(summaryview->mainwin);
- else
- gtkut_window_popup(summaryview->ext_messageview->window);
- msgview = summaryview->ext_messageview;
- summaryview->displayed = row;
- val = messageview_show(msgview, msginfo, all_headers);
- if (mimeview_tree_is_empty(msgview->mimeview))
- gtk_widget_grab_focus(summaryview->ctree);
- gtkut_ctree_node_move_if_on_the_edge(ctree, row,
- GTK_CMCLIST(summaryview->ctree)->focus_row);
- } else {
- msgview = summaryview->messageview;
- summaryview->displayed = row;
- if (!messageview_is_visible(msgview) &&
- gtk_window_is_active(GTK_WINDOW(summaryview->mainwin->window))) {
- main_window_toggle_message_view(summaryview->mainwin);
- GTK_EVENTS_FLUSH();
- }
- val = messageview_show(msgview, msginfo, all_headers);
- if (mimeview_tree_is_empty(msgview->mimeview))
- gtk_widget_grab_focus(summaryview->ctree);
- gtkut_ctree_node_move_if_on_the_edge(ctree, row,
- GTK_CMCLIST(summaryview->ctree)->focus_row);
+ MessageView *msgview = summaryview->messageview;
+ summaryview->displayed = row;
+ if (!messageview_is_visible(msgview) &&
+ gtk_window_is_active(GTK_WINDOW(summaryview->mainwin->window))) {
+ main_window_toggle_message_view(summaryview->mainwin);
+ GTK_EVENTS_FLUSH();
}
+ val = messageview_show(msgview, msginfo, all_headers);
+ if (mimeview_tree_is_empty(msgview->mimeview))
+ gtk_widget_grab_focus(summaryview->ctree);
+ gtkut_ctree_node_move_if_on_the_edge(ctree, row,
+ GTK_CMCLIST(summaryview->ctree)->focus_row);
}
if (val == 0 && MSG_IS_UNREAD(msginfo->flags)) {
@@ -3502,8 +3435,6 @@ gboolean summary_is_list(SummaryView *summaryview)
void summary_toggle_view(SummaryView *summaryview)
{
- if (prefs_common.layout_mode == SMALL_LAYOUT)
- return;
if (summary_is_locked(summaryview))
return;
if (!messageview_is_visible(summaryview->messageview) &&
@@ -5464,7 +5395,6 @@ static gboolean tooltip_cb (GtkWidget *widget,
MsgInfo *info = NULL;
GdkRectangle rect;
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
- gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
if (!prefs_common.show_tooltips)
return FALSE;
@@ -5506,7 +5436,7 @@ static gboolean tooltip_cb (GtkWidget *widget,
formatted = g_strdup(text);
g_strstrip(formatted);
- if ((vert_layout || small_layout) && prefs_common.two_line_vert)
+ if (vert_layout && prefs_common.two_line_vert)
gtk_tooltip_set_markup (tooltip, formatted);
else
gtk_tooltip_set_text (tooltip, formatted);
@@ -5560,7 +5490,6 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
SummaryColumnType type;
gint pos;
gboolean vert_layout = (prefs_common.layout_mode == VERTICAL_LAYOUT);
- gboolean small_layout = (prefs_common.layout_mode == SMALL_LAYOUT);
memset(titles, 0, sizeof(titles));
col_state = prefs_summary_column_get_config();
@@ -5633,7 +5562,7 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
FALSE);
if (((pos == summaryview->col_pos[S_COL_FROM] && !FOLDER_SHOWS_TO_HDR(summaryview->folder_item)) ||
(pos == summaryview->col_pos[S_COL_TO] && FOLDER_SHOWS_TO_HDR(summaryview->folder_item)) ||
- pos == summaryview->col_pos[S_COL_DATE]) && (vert_layout || small_layout) &&
+ pos == summaryview->col_pos[S_COL_DATE]) && vert_layout &&
prefs_common.two_line_vert)
gtk_cmclist_set_column_visibility
(GTK_CMCLIST(ctree), pos, FALSE);
@@ -5642,7 +5571,7 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
(GTK_CMCLIST(ctree), pos, col_state[pos].visible);
}
if (prefs_common.two_line_vert)
- gtk_sctree_set_use_markup(GTK_SCTREE(ctree), summaryview->col_pos[S_COL_SUBJECT], vert_layout||small_layout);
+ gtk_sctree_set_use_markup(GTK_SCTREE(ctree), summaryview->col_pos[S_COL_SUBJECT], vert_layout);
/* connect signal to the buttons for sorting */
#define CLIST_BUTTON_SIGNAL_CONNECT(col, func) \
@@ -5763,7 +5692,7 @@ void summary_set_column_order(SummaryView *summaryview)
gtk_cmclist_set_row_height(GTK_CMCLIST(ctree), 0);
normal_row_height = GTK_CMCLIST(ctree)->row_height;
- if ((prefs_common.layout_mode == SMALL_LAYOUT || prefs_common.layout_mode == VERTICAL_LAYOUT) &&
+ if ((prefs_common.layout_mode == VERTICAL_LAYOUT) &&
prefs_common.two_line_vert) {
gtk_cmclist_set_row_height(GTK_CMCLIST(summaryview->ctree), 2*normal_row_height + 2);
}
@@ -6339,12 +6268,6 @@ static void summary_start_drag(GtkWidget *widget, gint button, GdkEvent *event,
GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_DEFAULT, button, event,
-1, -1);
gtk_drag_set_icon_default(context);
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- GtkWidget *paned = gtk_widget_get_parent(GTK_WIDGET_PTR(summaryview));
- if (paned && GTK_IS_PANED(paned)) {
- mainwindow_reset_paned(GTK_PANED(paned));
- }
- }
}
static gboolean summary_return_to_list(void *data)
@@ -6357,11 +6280,7 @@ static gboolean summary_return_to_list(void *data)
static void summary_drag_end (GtkWidget *widget,
GdkDragContext *drag_context,
SummaryView *summaryview)
-{
- if (prefs_common.layout_mode == SMALL_LAYOUT) {
- g_timeout_add(250, summary_return_to_list, summaryview);
- }
-}
+{}
static void summary_drag_data_get(GtkWidget *widget,
GdkDragContext *drag_context,
@@ -7138,35 +7057,11 @@ void summary_update_unread(SummaryView *summaryview, FolderItem *removed_item)
guint replied, forwarded, locked, ignored, watched;
static gboolean tips_initialized = FALSE;
- if (prefs_common.layout_mode != SMALL_LAYOUT) {
- if (tips_initialized) {
- summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
- CLAWS_SET_TIP(summaryview->folder_pixmap_eventbox,
- NULL);
- tips_initialized = FALSE;
- }
+ if (!tips_initialized)
return;
- }
- folder_count_total_msgs(&new, &unread, &unreadmarked, &marked, &total,
- &replied, &forwarded, &locked, &ignored,
- &watched);
- if (removed_item) {
- total -= removed_item->total_msgs;
- new -= removed_item->new_msgs;
- unread -= removed_item->unread_msgs;
- }
-
- if (new > 0 || unread > 0) {
- tips_initialized = TRUE;
- summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN_HRM);
- CLAWS_SET_TIP(summaryview->folder_pixmap_eventbox,
- _("Go back to the folder list (You have unread messages)"));
- } else {
- tips_initialized = TRUE;
- summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
- CLAWS_SET_TIP(summaryview->folder_pixmap_eventbox,
- _("Go back to the folder list"));
- }
+ summary_set_folder_pixmap(summaryview, STOCK_PIXMAP_DIR_OPEN);
+ CLAWS_SET_TIP(summaryview->folder_pixmap_eventbox, NULL);
+ tips_initialized = FALSE;
}
static gboolean summary_update_folder_item_hook(gpointer source, gpointer data)