From 1b666f53e4d031723652e6834ec6088359f48186 Mon Sep 17 00:00:00 2001 From: Tamas TEVESZ Date: Fri, 2 Apr 2010 12:05:53 +0200 Subject: [PATCH] Make WPrefs' Expert panel scrollable --- WPrefs.app/Expert.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/WPrefs.app/Expert.c b/WPrefs.app/Expert.c index b8f8b465..f8b4daca 100644 --- a/WPrefs.app/Expert.c +++ b/WPrefs.app/Expert.c @@ -56,19 +56,30 @@ static void showData(_Panel * panel) static void createPanel(Panel * p) { _Panel *panel = (_Panel *) p; + WMScrollView *sv; + WMFrame *f; int i; panel->box = WMCreateBox(panel->parent); WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2); - for (i = 0; i < 9; i++) { - panel->swi[i] = WMCreateSwitchButton(panel->box); + sv = WMCreateScrollView(panel->box); + WMResizeWidget(sv, 500, 215); + WMMoveWidget(sv, 12, 10); + WMSetScrollViewRelief(sv, WRSunken); + WMSetScrollViewHasVerticalScroller(sv, True); + WMSetScrollViewHasHorizontalScroller(sv, False); + + f = WMCreateFrame(panel->box); + WMResizeWidget(f, 495, sizeof(panel->swi) / sizeof(char *) * 25 + 8); + WMSetFrameRelief(f, WRFlat); + + for (i = 0; i < sizeof(panel->swi) / sizeof(char *); i++) { + panel->swi[i] = WMCreateSwitchButton(f); WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25); - WMMoveWidget(panel->swi[i], 20, 20 + i * 25); + WMMoveWidget(panel->swi[i], 5, 5 + i * 25); } - /* XXX: it would be HIGHLY desireable if this could scroll vertically */ - WMSetButtonText(panel->swi[0], _("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME.")); WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset).")); @@ -82,8 +93,9 @@ static void createPanel(Panel * p) WMSetButtonEnabled(panel->swi[6], True); - WMRealizeWidget(panel->box); WMMapSubwidgets(panel->box); + WMSetScrollViewContentView(sv, WMWidgetView(f)); + WMRealizeWidget(panel->box); showData(panel); } -- 2.11.4.GIT