From 7465c51ef2208e8bac75f646222cd3495fa602a3 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Thu, 27 Aug 2020 09:05:56 +0430 Subject: [PATCH] Base+LibGUI+Spreadsheet: Add icons for Spreadsheet Also adds a Spreadsheet.af. --- Applications/Spreadsheet/main.cpp | 9 +++++---- Base/res/apps/Spreadsheet.af | 11 +++++++++++ Base/res/icons/16x16/app-spreadsheet.png | Bin 0 -> 187 bytes Base/res/icons/16x16/filetype-spreadsheet.png | Bin 0 -> 223 bytes Base/res/icons/32x32/app-spreadsheet.png | Bin 0 -> 207 bytes Base/res/icons/32x32/filetype-spreadsheet.png | Bin 0 -> 265 bytes Libraries/LibGUI/FileIconProvider.cpp | 3 ++- 7 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 Base/res/apps/Spreadsheet.af create mode 100644 Base/res/icons/16x16/app-spreadsheet.png create mode 100644 Base/res/icons/16x16/filetype-spreadsheet.png create mode 100644 Base/res/icons/32x32/app-spreadsheet.png create mode 100644 Base/res/icons/32x32/filetype-spreadsheet.png diff --git a/Applications/Spreadsheet/main.cpp b/Applications/Spreadsheet/main.cpp index 6e0f6e9ef9..e38a7d40dd 100644 --- a/Applications/Spreadsheet/main.cpp +++ b/Applications/Spreadsheet/main.cpp @@ -86,6 +86,7 @@ int main(int argc, char* argv[]) auto window = GUI::Window::construct(); window->set_title("Spreadsheet"); window->resize(640, 480); + window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-spreadsheet.png")); auto& spreadsheet_widget = window->set_main_widget(NonnullRefPtrVector {}, filename == nullptr); @@ -113,8 +114,8 @@ int main(int argc, char* argv[]) file_menu.add_action(GUI::CommonActions::make_save_action([&](auto&) { if (spreadsheet_widget.current_filename().is_empty()) { - String name = "sheet"; - Optional save_path = GUI::FilePicker::get_save_filepath(window, name, "json"); + String name = "workbook"; + Optional save_path = GUI::FilePicker::get_save_filepath(window, name, "sheets"); if (!save_path.has_value()) return; @@ -126,8 +127,8 @@ int main(int argc, char* argv[]) file_menu.add_action(GUI::CommonActions::make_save_as_action([&](auto&) { auto current_filename = spreadsheet_widget.current_filename(); - String name = "sheet"; - Optional save_path = GUI::FilePicker::get_save_filepath(window, name, "json"); + String name = "workbook"; + Optional save_path = GUI::FilePicker::get_save_filepath(window, name, "sheets"); if (!save_path.has_value()) return; diff --git a/Base/res/apps/Spreadsheet.af b/Base/res/apps/Spreadsheet.af new file mode 100644 index 0000000000..5a9551a100 --- /dev/null +++ b/Base/res/apps/Spreadsheet.af @@ -0,0 +1,11 @@ +[App] +Name=Spreadsheet +Executable=/bin/Spreadsheet +Category=Utilities + +[Icons] +16x16=/res/icons/16x16/app-spreadsheet.png +32x32=/res/icons/32x32/app-spreadsheet.png + +[Launcher] +FileTypes=sheets diff --git a/Base/res/icons/16x16/app-spreadsheet.png b/Base/res/icons/16x16/app-spreadsheet.png new file mode 100644 index 0000000000000000000000000000000000000000..01ec1da34f624bd41ff098ba4842fa8f18a51666 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7nmk<`Lo80eoovW;*nr1% ze%HeCplxx>qQ&kXiPpQU`)TT?os+vb`ZBGi*$BMguKm%hBC}vsFJqb-L(#Pz`@$HO z9dDWG`RnKlTZf`znQu3w=SGX9YED@y^GZ&$>!+phCEIl@^%EZyAIr@?{7E)6_v0I3 r^$+Y_#*8br-YY(L+x-3R=e!^OR{6}zNmXHBU|{fc^>bP0l+XkKW)4eD literal 0 HcmV?d00001 diff --git a/Base/res/icons/16x16/filetype-spreadsheet.png b/Base/res/icons/16x16/filetype-spreadsheet.png new file mode 100644 index 0000000000000000000000000000000000000000..a0a2fafefde95c07728e1b10cfca83d61a6db56c GIT binary patch literal 223 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7mU+53hFF|_JIRpmkO7Zt zeM95w9nz~e7dFNy2}S2mQjON1qV00ZbJKxz$Ei{rS*K4;x4ALxZTjg0{YJSCp*N2O zd9g9LJeg6vuYC7Pt;n4Qp-Vd^Ol_O$7Ao${KVRyorjlRbx3ya(^bS9E%`p?667*v4 z@{T=g%U=mH9H@|HWH`6eQeEkcCoU8cJAGB7YOc)I$ztaD0e0st&aSj_+c literal 0 HcmV?d00001 diff --git a/Base/res/icons/32x32/app-spreadsheet.png b/Base/res/icons/32x32/app-spreadsheet.png new file mode 100644 index 0000000000000000000000000000000000000000..9e47d069cd24f1469da351df566ce2278a77aac7 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0y~yU{C;I4mJh`hT^KKFANL}(>z@qLn02p4R_=^pulta z;p$iO|8)PITz5M5ZooCZ?8NN6t|XyF63?eRwCrYFu-0PBwO2Q1Gb~u^q_0vSa$F)_ zQ*Wt7=}{GSyR{b2ZAucCBJk13PxGy+gX@A#%g>z^QGRrRwUqrx-a*^1o68Rv zB}i`IiD1)Vp4Rw3rNPyK=`Vlvjh?cv4Y_i?Sb@jY z_sYVjCTZPsqMs;O`tVJPRxw`g7`y8JTCb4SW4gTE|5@CO{GTPCbXj()Xs5GaquR|) zI$<bmr8i{(?Rl&@Sf*v~LOWBlAudB7$>cEO93l9D8&wO?7jFWFm? U@ni8k1_lNOPgg&ebxsLQ0HQ^31poj5 literal 0 HcmV?d00001 diff --git a/Libraries/LibGUI/FileIconProvider.cpp b/Libraries/LibGUI/FileIconProvider.cpp index 2fd3e514dd..c152b83077 100644 --- a/Libraries/LibGUI/FileIconProvider.cpp +++ b/Libraries/LibGUI/FileIconProvider.cpp @@ -48,7 +48,8 @@ namespace GUI { F(python, ".py") \ F(sound, ".wav") \ F(ini, ".ini") \ - F(text, ".txt") + F(text, ".txt") \ + F(spreadsheet, ".sheets") #define __ENUMERATE_FILETYPE(filetype_name, ...) \ static Icon s_filetype_##filetype_name##_icon;