mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Icon creation in only one function
This patch avoids the icon creation in winspector.c and adds the ability of creating + paiting and unpainting instead of destroying the icon. Now the icon is always created by wApplicationCreate and the icon exists while the application is runnning. If the user doesn't want an appicon the winspector.c will not remove the icon, it will only not paint it on the screen. But the icon is still created. Probably the most difficult part in this code is how to handle the icons in the iconlist. We must include the icon in the iconlist when it is painted, not when it is created. And it must be removed when it is unpainted. We can check if the icon is in the iconlist if icon->next AND icon->prev are null, else it is on the applist. If it is included we must not paint it again because the function PlaceIcon() will calculate a new icon place in the screen including the icon!, then a hole is painted.
This commit is contained in:
committed by
Carlos R. Mafra
parent
952f6bfb1c
commit
e357e94896
@@ -770,15 +770,13 @@ static void applySettings(WMButton *button, InspectorPanel *panel)
|
||||
if (wapp) {
|
||||
/* do application wide stuff */
|
||||
WSETUFLAG(wapp->main_window_desc, start_hidden, WMGetButtonSelected(panel->appChk[0]));
|
||||
|
||||
WSETUFLAG(wapp->main_window_desc, no_appicon, WMGetButtonSelected(panel->appChk[1]));
|
||||
|
||||
WSETUFLAG(wapp->main_window_desc, shared_appicon, WMGetButtonSelected(panel->appChk[2]));
|
||||
|
||||
if (WFLAGP(wapp->main_window_desc, no_appicon))
|
||||
removeAppIconFor(wapp);
|
||||
unpaint_app_icon(wapp);
|
||||
else
|
||||
makeAppIconFor(wapp);
|
||||
paint_app_icon(wapp);
|
||||
|
||||
if (wapp->app_icon && wapp->main_window == wwin->client_win) {
|
||||
char *file = WMGetTextFieldText(panel->fileText);
|
||||
|
||||
Reference in New Issue
Block a user