diff --git a/WPrefs.app/Icons.c b/WPrefs.app/Icons.c index 4e7f2375..e68da569 100644 --- a/WPrefs.app/Icons.c +++ b/WPrefs.app/Icons.c @@ -60,6 +60,8 @@ typedef struct _Panel { CallbackRec callbacks; + Bool have_legacy_apercu; + WMWidget *parent; WMFrame *posF; @@ -206,6 +208,7 @@ static void showData(_Panel * panel) * new settings * This hack should be kept for at least 2 years, that means >= 2017. */ + panel->have_legacy_apercu = False; str = GetStringForKey("MiniwindowPreviewBalloons"); if (str != NULL) { /* New names found, use them in priority */ @@ -221,9 +224,18 @@ static void showData(_Panel * panel) /* No new names, try the legacy names */ b = GetBoolForKey("MiniwindowApercuBalloons"); if (b) { + panel->have_legacy_apercu = True; i = GetIntegerForKey("ApercuSize"); + + /* + * In the beginning, the option was coded as a multiple of the icon + * size; then it was converted to pixel size + */ + if (i < 24) + i *= GetIntegerForKey("IconSize"); + if (i <= minipreview_minimum_size) - i = minipreview_minimum_size; + i = minipreview_minimum_size + 1; /* +1 to not display as "off" */ } else { i = minipreview_minimum_size; } @@ -466,6 +478,10 @@ static void storeData(_Panel * panel) } SetIntegerForKey(i, "MiniPreviewSize"); } + if (panel->have_legacy_apercu) { + RemoveObjectForKey("MiniwindowApercuBalloons"); + RemoveObjectForKey("ApercuSize"); + } for (i = 0; i < wlengthof(icon_animation); i++) { if (WMGetButtonSelected(panel->animB[i])) {