diff options
| author | Matthias Melcher <github@matthiasm.com> | 2023-08-26 17:58:10 +0200 |
|---|---|---|
| committer | Matthias Melcher <github@matthiasm.com> | 2023-08-29 01:38:39 +0200 |
| commit | 496289fd3566c2bcbb229b1cb7280fc6eeadf9e7 (patch) | |
| tree | 310a057d38b8534feb8899bd625c12bc5f1c9e1a /fluid/alignment_panel.fl | |
| parent | 5da15de17469047d313cd574aaa4bc226bd4cae2 (diff) | |
FLUID: simplifies filename handling
Diffstat (limited to 'fluid/alignment_panel.fl')
| -rw-r--r-- | fluid/alignment_panel.fl | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/fluid/alignment_panel.fl b/fluid/alignment_panel.fl index c7eea9bd7..1ff9d2c99 100644 --- a/fluid/alignment_panel.fl +++ b/fluid/alignment_panel.fl @@ -116,7 +116,7 @@ Function {make_settings_window()} {open xywh {10 10 320 530} selection_color 12 labelsize 11 labelcolor 255 } { Fl_Group {} { - label General open + label General open selected image {icons/general_64.png} compress_image 1 xywh {10 60 320 480} labelsize 11 code0 {o->image()->scale(36, 24);} } { @@ -372,7 +372,7 @@ g_layout_list.update_dialogs();} w_layout_menu_delete->activate(); } w_layout_menu_storage[suite.storage_]->setonly(); -}} +}} open xywh {296 78 24 24} } { MenuItem w_layout_menu_rename { @@ -440,25 +440,13 @@ g_layout_list.update_dialogs();} fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE); fnfc.options(Fl_Native_File_Chooser::SAVEAS_CONFIRM | Fl_Native_File_Chooser::USE_FILTER_EXT); fnfc.filter("FLUID Layouts\\t*.fll\\n"); - if (g_layout_list.filename_) { - char *fn = fl_strdup(g_layout_list.filename_); - char *name = (char*)fl_filename_name(g_layout_list.filename_); - if (name > fn) { - name[-1] = 0; - fnfc.directory(fn); - fnfc.preset_file(name); - ::free(fn); - } else if (name) { - fnfc.preset_file(name); - ::free(fn); - } - } + Fl_String filename = g_layout_list.filename_; + fnfc.directory(fl_filename_path(filename).c_str()); + fnfc.preset_file(fl_filename_name(filename).c_str()); if (fnfc.show() != 0) return; const char *new_filename = fnfc.filename(); if (!new_filename) return; - if (g_layout_list.filename_) - ::free(g_layout_list.filename_); - g_layout_list.filename_ = fl_strdup(new_filename); + g_layout_list.filename_ = new_filename; g_layout_list.save(new_filename);} xywh {0 0 31 20} divider code0 {\#include <FL/Fl_Native_File_Chooser.H>} @@ -988,7 +976,7 @@ Function {make_shell_window()} {open } { Fl_Button {} { label Clear - callback {shell_run_terminal->clear();} selected + callback {shell_run_terminal->clear();} xywh {10 395 94 25} } Fl_Box {} { |
