From 2beb5f2c52c27340ebfc1674e6fa82bb138e769c Mon Sep 17 00:00:00 2001 From: Tim Taenny Date: Wed, 30 Jan 2019 22:03:35 +0100 Subject: [PATCH] Fixed icon loading during Attribute Inspector startup When opening the "Icon and Initial Workspace" panel of the Attribute Inspector, the Miniwindow Image and the corresponding text field were always empty, even if an icon had been selected, applied and saved before. The file name was not loaded from the database on startup of the inspector window. With this change, the icon and the text field are properly set on startup of the inspector window. --- src/winspector.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/winspector.c b/src/winspector.c index 4f12e5ab..5a38fafb 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -1253,7 +1253,7 @@ static InspectorPanel *createInspectorForWindow(WWindow *wwin, int xpos, int ypo wWindowMap(panel->frame); - showIconFor(WMWidgetScreen(panel->alwChk), panel, wwin->wm_instance, wwin->wm_class, UPDATE_TEXT_FIELD); + showIconFor(WMWidgetScreen(panel->alwChk), panel, wwin->wm_instance, wwin->wm_class, REVERT_TO_DEFAULT); return panel; } @@ -1365,6 +1365,7 @@ static void create_tab_window_advanced(WWindow *wwin, InspectorPanel *panel, int static void create_tab_icon_workspace(WWindow *wwin, InspectorPanel *panel) { + const char *db_icon; WScreen *scr = wwin->screen_ptr; int i = 0; @@ -1394,7 +1395,8 @@ static void create_tab_icon_workspace(WWindow *wwin, InspectorPanel *panel) panel->fileText = WMCreateTextField(panel->iconFrm); WMMoveWidget(panel->fileText, 20, 105); WMResizeWidget(panel->fileText, PWIDTH - (2 * 20) - (2 * 15), 20); - WMSetTextFieldText(panel->fileText, NULL); + db_icon = wDefaultGetIconFile(wwin->wm_instance, wwin->wm_class, False); + WMSetTextFieldText(panel->fileText, db_icon); WMAddNotificationObserver(textEditedObserver, panel, WMTextDidEndEditingNotification, panel->fileText); panel->alwChk = WMCreateSwitchButton(panel->iconFrm);