Base+LibGUI+Spreadsheet: Add icons for Spreadsheet

Also adds a Spreadsheet.af.
This commit is contained in:
AnotherTest 2020-08-27 09:05:56 +04:30 committed by Andreas Kling
parent dd4bd0943a
commit 7465c51ef2
Notes: sideshowbarker 2024-07-19 03:06:20 +09:00
7 changed files with 18 additions and 5 deletions

View file

@ -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<Spreadsheet::SpreadsheetWidget>(NonnullRefPtrVector<Spreadsheet::Sheet> {}, 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<String> save_path = GUI::FilePicker::get_save_filepath(window, name, "json");
String name = "workbook";
Optional<String> 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<String> save_path = GUI::FilePicker::get_save_filepath(window, name, "json");
String name = "workbook";
Optional<String> save_path = GUI::FilePicker::get_save_filepath(window, name, "sheets");
if (!save_path.has_value())
return;

View file

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

View file

@ -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;