mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
wmaker: minor fixes for the size of an aperçu
There was a probable bug when reading settings, because the function used was 'getInt' which would try to store the result in a 'char'. As it would be probably easier for user to have the value directly in pixels, the storage is now done in an int so there won't be problem anymore. Changed the behaviour of the constant APERCU_BORDER, which would be assumed to be the size of the border in pixel, but in previous code it was actually the sum of the two border (1 on each side). All maths have been changed to have it as a single border width. Took opportunity to group variable assignation for titleHeight and shortenTitle in a single place, because it is not convenient to have them spread around (one value in the beginning and others later in the code) and using default values prevents some checks that modern compiler can do to help produce safer code. Signed-off-by: Christophe CURIS <christophe.curis@free.fr> Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
committed by
Carlos R. Mafra
parent
572af55c9f
commit
38d160cb8c
@@ -502,7 +502,7 @@ WDefaultEntry optionList[] = {
|
||||
&wPreferences.strict_windoze_cycle, getBool, NULL, NULL, NULL},
|
||||
{"SwitchPanelOnlyOpen", "NO", NULL,
|
||||
&wPreferences.panel_only_open, getBool, NULL, NULL, NULL},
|
||||
{"ApercuSize", "2", NULL,
|
||||
{"ApercuSize", "128", NULL,
|
||||
&wPreferences.apercu_size, getInt, NULL, NULL, NULL},
|
||||
|
||||
/* style options */
|
||||
@@ -1181,6 +1181,22 @@ void wReadDefaults(WScreen * scr, WMPropList * new_dict)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Backward Compatibility:
|
||||
* the option 'apercu_size' used to be coded as a multiple of the icon size in v0.95.6
|
||||
* it is now expressed directly in pixels, but to avoid breaking user's setting we check
|
||||
* for old coding and convert it now.
|
||||
* This code should probably stay for at least 2 years, you should not consider removing
|
||||
* it before year 2017
|
||||
*/
|
||||
if (wPreferences.apercu_size < 24) {
|
||||
/* 24 is the minimum icon size proposed in WPref's settings */
|
||||
wPreferences.apercu_size *= wPreferences.icon_size;
|
||||
if (wPreferences.miniwin_apercu_balloon)
|
||||
wwarning(_("your ApercuSize setting is using old syntax, it is converted to %d pixels; consider running WPrefs.app to update your settings"),
|
||||
wPreferences.apercu_size);
|
||||
}
|
||||
|
||||
if (needs_refresh != 0 && !scr->flags.startup) {
|
||||
int foo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user