From 13a9ebedcfa728527da439e8b8739534ca2fed6b Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Sun, 18 May 2014 22:17:04 -0500 Subject: [PATCH] WPrefs: updates to FrameBorderColor/FrameSelectedBorderColor options In response to Amadeusz's comments regarding my patch "WPrefs: Add ability to edit FrameBorderColor/FrameSelectedBorderColor", this new patch attempts to reduce the confusion between focused and selected windows. In particular, only the frame border color for non-selected windows appears in the preview. The frame border color for selected window colors can still be changed, but it does not appear in the preview. In addition, the hand icon has been removed from the preview for these two options. I also looked into the possibility of adding a new border color for focused windows. This appears to be nontrivial, as the border color belongs to WFrameWindow, but the state of being focused belongs to WWindow. --- WPrefs.app/Appearance.c | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/WPrefs.app/Appearance.c b/WPrefs.app/Appearance.c index 256a74d0..9b42034f 100644 --- a/WPrefs.app/Appearance.c +++ b/WPrefs.app/Appearance.c @@ -388,8 +388,8 @@ static WMRect previewColorPositions[] = { {{30, 160}, {90, 20}}, {{30, 180}, {90, 20}}, {{30, 200}, {90, 20}}, - {{30, 40}, {190, 20}}, - {{30, 10}, {190, 20}}, + {{0, 0}, {0, 0}}, + {{0, 0}, {0, 0}}, {{155, 130}, {64, 64}}, {{155, 130}, {64, 64}}, {{155, 130}, {64, 64}}, @@ -785,7 +785,7 @@ static void updatePreviewBox(_Panel * panel, int elements) if (elements & (1 << PFOCUSED)) { renderPreview(panel, gc, PFOCUSED, RBEV_RAISED2); - colorUpdate |= 1 << FTITLE_COL | 1 << FSBORDER_COL; + colorUpdate |= 1 << FTITLE_COL | 1 << FBORDER_COL; } if (elements & (1 << PUNFOCUSED)) { renderPreview(panel, gc, PUNFOCUSED, RBEV_RAISED2); @@ -1365,8 +1365,8 @@ static void changeColorPage(WMWidget * w, void *data) {5, 160}, {5, 180}, {5, 180}, - {5, 40}, - {5, 10}, + {-22, -21}, + {-22, -21}, {130, 140}, {130, 140}, {130, 140}, @@ -1487,6 +1487,12 @@ static void updateColorPreviewBox(_Panel * panel, int elements) _("Highlighted")); } if (elements & (1 << FBORDER_COL)) { + XDrawRectangle(dpy, pnot, + WMColorGC(panel->colors[FBORDER_COL]), + 29, 9, 190, 20); + XDrawRectangle(dpy, d, + WMColorGC(panel->colors[FBORDER_COL]), + 29, 9, 190, 20); XDrawRectangle(dpy, pnot, WMColorGC(panel->colors[FBORDER_COL]), 29, 39, 190, 20); @@ -1536,16 +1542,6 @@ static void updateColorPreviewBox(_Panel * panel, int elements) WMColorGC(panel->colors[FBORDER_COL]), 119, 120, 119, 220); } - if (elements & (1 << FSBORDER_COL)) { - XDrawRectangle(dpy, pnot, - WMColorGC(panel-> - colors[FSBORDER_COL]), - 29, 9, 190, 20); - XDrawRectangle(dpy, d, - WMColorGC(panel-> - colors[FSBORDER_COL]), - 29, 9, 190, 20); - } /* if (elements & (1 << ICONT_COL)) { @@ -1838,8 +1834,8 @@ static void createPanel(Panel * p) WMAddPopUpButtonItem(panel->colP, _("Disabled Menu Item Text")); WMAddPopUpButtonItem(panel->colP, _("Menu Highlight Color")); WMAddPopUpButtonItem(panel->colP, _("Highlighted Menu Text Color")); - WMAddPopUpButtonItem(panel->colP, _("Frame Border Color")); - WMAddPopUpButtonItem(panel->colP, _("Selected Frame Border Color")); + WMAddPopUpButtonItem(panel->colP, _("Window Border Color")); + WMAddPopUpButtonItem(panel->colP, _("Selected Window Border Color")); /* WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title")); WMAddPopUpButtonItem(panel->colP, _("Miniwindow Title Back"));