From 44c4b03a15feffd3d00a67d470196aa9db17f3a3 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Wed, 7 Jul 2021 14:12:05 +0900 Subject: [PATCH] file-browser: Set the default view mode to TILES --- apps/file-browser.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/apps/file-browser.c b/apps/file-browser.c index df4a6b61..238f6de9 100644 --- a/apps/file-browser.c +++ b/apps/file-browser.c @@ -1,13 +1,15 @@ -/* vim: tabstop=4 shiftwidth=4 noexpandtab - * This file is part of ToaruOS and is released under the terms - * of the NCSA / University of Illinois License - see LICENSE.md - * Copyright (C) 2018 K. Lange - * - * file-browser - Graphical file manager. +/** + * @brief Graphical file browser + * @file apps/file-browser.c * * Based on the original Python implementation and inspired by * Nautilus and Thunar. Also provides a "wallpaper" mode for * managing the desktop backgrond. + * + * @copyright + * This file is part of ToaruOS and is released under the terms + * of the NCSA / University of Illinois License - see LICENSE.md + * Copyright (C) 2018-2021 K. Lange */ #include #include @@ -1317,7 +1319,7 @@ static void _menu_action_paste(struct MenuEntry * entry) { static void _menu_action_about(struct MenuEntry * entry) { /* Show About dialog */ char about_cmd[1024] = "\0"; - strcat(about_cmd, "about \"About File Browser\" /usr/share/icons/48/folder.png \"ToaruOS File Browser\" \"(C) 2018 K. Lange\n-\nPart of ToaruOS, which is free software\nreleased under the NCSA/University of Illinois\nlicense.\n-\n%https://toaruos.org\n%https://github.com/klange/toaruos\" "); + strcat(about_cmd, "about \"About File Browser\" /usr/share/icons/48/folder.png \"ToaruOS File Browser\" \"© 2018-2021 K. Lange\n-\nPart of ToaruOS, which is free software\nreleased under the NCSA/University of Illinois\nlicense.\n-\n%https://toaruos.org\n%https://github.com/klange/toaruos\" "); char coords[100]; sprintf(coords, "%d %d &", (int)main_window->x + (int)main_window->width / 2, (int)main_window->y + (int)main_window->height / 2); strcat(about_cmd, coords); @@ -1443,9 +1445,6 @@ static void set_view_mode(int mode) { view_mode = VIEW_MODE_LIST; break; } - - reinitialize_contents(); - redraw_window(); } /** @@ -1463,6 +1462,8 @@ static void _menu_action_view_mode(struct MenuEntry * entry) { mode = VIEW_MODE_LIST; } set_view_mode(mode); + reinitialize_contents(); + redraw_window(); } /** @@ -1749,6 +1750,7 @@ int main(int argc, char * argv[]) { } else { main_window = yutani_window_create(yctx, 800, 600); yutani_window_move(yctx, main_window, yctx->display_width / 2 - main_window->width / 2, yctx->display_height / 2 - main_window->height / 2); + set_view_mode(VIEW_MODE_TILES); } if (arg_ind < argc) {