Base+LibGUI+Spreadsheet: Add icons for Spreadsheet
Also adds a Spreadsheet.af.
This commit is contained in:
parent
dd4bd0943a
commit
7465c51ef2
Notes:
sideshowbarker
2024-07-19 03:06:20 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/7465c51ef22 Pull-request: https://github.com/SerenityOS/serenity/pull/3312 Reviewed-by: https://github.com/awesomekling
7 changed files with 18 additions and 5 deletions
|
@ -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;
|
||||
|
||||
|
|
11
Base/res/apps/Spreadsheet.af
Normal file
11
Base/res/apps/Spreadsheet.af
Normal 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
|
BIN
Base/res/icons/16x16/app-spreadsheet.png
Normal file
BIN
Base/res/icons/16x16/app-spreadsheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 187 B |
BIN
Base/res/icons/16x16/filetype-spreadsheet.png
Normal file
BIN
Base/res/icons/16x16/filetype-spreadsheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 223 B |
BIN
Base/res/icons/32x32/app-spreadsheet.png
Normal file
BIN
Base/res/icons/32x32/app-spreadsheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 207 B |
BIN
Base/res/icons/32x32/filetype-spreadsheet.png
Normal file
BIN
Base/res/icons/32x32/filetype-spreadsheet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 265 B |
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue