mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
Revert "wmaker: fix clearing of window attribute that was not saved properly"
This reverts commit 14d1d3f141.
Conflicts:
src/winspector.c
Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
@@ -203,7 +203,6 @@ typedef struct InspectorPanel {
|
|||||||
|
|
||||||
/* second page. attributes */
|
/* second page. attributes */
|
||||||
WMFrame *attrFrm;
|
WMFrame *attrFrm;
|
||||||
WMButton *attrClient[sizeof(window_attribute) / sizeof(window_attribute[0])];
|
|
||||||
WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])];
|
WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])];
|
||||||
|
|
||||||
/* 3rd page. more attributes */
|
/* 3rd page. more attributes */
|
||||||
@@ -643,27 +642,8 @@ static void saveSettings(WMWidget *button, void *client_data)
|
|||||||
|
|
||||||
/* Attributes... --> Window Attributes */
|
/* Attributes... --> Window Attributes */
|
||||||
for (i = 0; i < wlengthof(window_attribute); i++) {
|
for (i = 0; i < wlengthof(window_attribute); i++) {
|
||||||
WMPropList *old_value;
|
value = (WMGetButtonSelected(panel->attrChk[i]) != 0) ? Yes : No;
|
||||||
int state;
|
different |= insertAttribute(dict, winDic, pl_attribute[i], value, flags);
|
||||||
|
|
||||||
old_value = WMGetFromPLDictionary(winDic, pl_attribute[i]);
|
|
||||||
state = WMGetButtonSelected(panel->attrChk[i]);
|
|
||||||
if (state > 0) {
|
|
||||||
if ((old_value == NULL) || !getBool(old_value)) {
|
|
||||||
WMPutInPLDictionary(winDic, pl_attribute[i], Yes);
|
|
||||||
different |= 1;
|
|
||||||
}
|
|
||||||
} else if (state == 0) {
|
|
||||||
if ((old_value == NULL) || getBool(old_value)) {
|
|
||||||
WMPutInPLDictionary(winDic, pl_attribute[i], No);
|
|
||||||
different |= 1;
|
|
||||||
}
|
|
||||||
} else { /* (state < 0) */
|
|
||||||
if (old_value != NULL) {
|
|
||||||
WMRemoveFromPLDictionary(winDic, pl_attribute[i]);
|
|
||||||
different |= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attributes... --> Advanced Options */
|
/* Attributes... --> Advanced Options */
|
||||||
@@ -746,19 +726,12 @@ static void applySettings(WMWidget *button, void *client_data)
|
|||||||
|
|
||||||
/* Attributes... --> Window Attributes */
|
/* Attributes... --> Window Attributes */
|
||||||
for (i = 0; i < wlengthof(window_attribute); i++) {
|
for (i = 0; i < wlengthof(window_attribute); i++) {
|
||||||
int state;
|
if (WMGetButtonSelected(panel->attrChk[i]))
|
||||||
|
|
||||||
state = WMGetButtonSelected(panel->attrChk[i]);
|
|
||||||
|
|
||||||
if (state > 0)
|
|
||||||
set_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
set_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
||||||
else
|
else
|
||||||
clear_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
clear_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
||||||
|
|
||||||
if (state < 0)
|
set_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
|
||||||
clear_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
|
|
||||||
else
|
|
||||||
set_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Attributes... --> Advanced Options */
|
/* Attributes... --> Advanced Options */
|
||||||
@@ -931,7 +904,7 @@ static void revertSettings(WMWidget *button, void *client_data)
|
|||||||
if (is_userdef)
|
if (is_userdef)
|
||||||
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
||||||
else
|
else
|
||||||
flag = -1;
|
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
|
||||||
|
|
||||||
WMSetButtonSelected(panel->attrChk[i], flag);
|
WMSetButtonSelected(panel->attrChk[i], flag);
|
||||||
}
|
}
|
||||||
@@ -1342,31 +1315,15 @@ static void create_tab_window_attributes(WWindow *wwin, InspectorPanel *panel, i
|
|||||||
for (i = 0; i < wlengthof(window_attribute); i++) {
|
for (i = 0; i < wlengthof(window_attribute); i++) {
|
||||||
int is_userdef, flag;
|
int is_userdef, flag;
|
||||||
|
|
||||||
/* Read-only button to display the state requested by the application */
|
|
||||||
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
|
|
||||||
|
|
||||||
panel->attrClient[i] = WMCreateSwitchButton(panel->attrFrm);
|
|
||||||
WMMoveWidget(panel->attrClient[i], 10, 20 * (i + 1));
|
|
||||||
WMResizeWidget(panel->attrClient[i], 20, 20);
|
|
||||||
WMSetButtonText(panel->attrClient[i], NULL);
|
|
||||||
WMSetButtonSelected(panel->attrClient[i], flag);
|
|
||||||
WMSetButtonEnabled(panel->attrClient[i], False);
|
|
||||||
|
|
||||||
WMSetBalloonTextForView(_("Shows the state that was asked by the application.\n"
|
|
||||||
"You can use the checkbox on the right to change this setting;\n"
|
|
||||||
"when it is grayed it means to follow application's choice."),
|
|
||||||
WMWidgetView(panel->attrClient[i]));
|
|
||||||
|
|
||||||
/* Button to let user override this choice */
|
|
||||||
is_userdef = get_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
|
is_userdef = get_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
|
||||||
if (is_userdef)
|
if (is_userdef)
|
||||||
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
|
||||||
else
|
else
|
||||||
flag = -1;
|
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
|
||||||
|
|
||||||
panel->attrChk[i] = WMCreateButton(panel->attrFrm, WBTTriState);
|
panel->attrChk[i] = WMCreateSwitchButton(panel->attrFrm);
|
||||||
WMMoveWidget(panel->attrChk[i], 30, 20 * (i + 1));
|
WMMoveWidget(panel->attrChk[i], 10, 20 * (i + 1));
|
||||||
WMResizeWidget(panel->attrChk[i], frame_width - 45, 20);
|
WMResizeWidget(panel->attrChk[i], frame_width - 15, 20);
|
||||||
WMSetButtonSelected(panel->attrChk[i], flag);
|
WMSetButtonSelected(panel->attrChk[i], flag);
|
||||||
WMSetButtonText(panel->attrChk[i], _(window_attribute[i].caption));
|
WMSetButtonText(panel->attrChk[i], _(window_attribute[i].caption));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user