mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 05:48:01 +01:00
Make WPrefs' Expert panel scrollable
This commit is contained in:
committed by
Carlos R. Mafra
parent
b59575e709
commit
1b666f53e4
@@ -56,18 +56,29 @@ static void showData(_Panel * panel)
|
|||||||
static void createPanel(Panel * p)
|
static void createPanel(Panel * p)
|
||||||
{
|
{
|
||||||
_Panel *panel = (_Panel *) p;
|
_Panel *panel = (_Panel *) p;
|
||||||
|
WMScrollView *sv;
|
||||||
|
WMFrame *f;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
panel->box = WMCreateBox(panel->parent);
|
panel->box = WMCreateBox(panel->parent);
|
||||||
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
||||||
|
|
||||||
for (i = 0; i < 9; i++) {
|
sv = WMCreateScrollView(panel->box);
|
||||||
panel->swi[i] = WMCreateSwitchButton(panel->box);
|
WMResizeWidget(sv, 500, 215);
|
||||||
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
|
WMMoveWidget(sv, 12, 10);
|
||||||
WMMoveWidget(panel->swi[i], 20, 20 + i * 25);
|
WMSetScrollViewRelief(sv, WRSunken);
|
||||||
}
|
WMSetScrollViewHasVerticalScroller(sv, True);
|
||||||
|
WMSetScrollViewHasHorizontalScroller(sv, False);
|
||||||
|
|
||||||
/* XXX: it would be HIGHLY desireable if this could scroll vertically */
|
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], 5, 5 + i * 25);
|
||||||
|
}
|
||||||
|
|
||||||
WMSetButtonText(panel->swi[0],
|
WMSetButtonText(panel->swi[0],
|
||||||
_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
|
_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
|
||||||
@@ -82,8 +93,9 @@ static void createPanel(Panel * p)
|
|||||||
|
|
||||||
WMSetButtonEnabled(panel->swi[6], True);
|
WMSetButtonEnabled(panel->swi[6], True);
|
||||||
|
|
||||||
WMRealizeWidget(panel->box);
|
|
||||||
WMMapSubwidgets(panel->box);
|
WMMapSubwidgets(panel->box);
|
||||||
|
WMSetScrollViewContentView(sv, WMWidgetView(f));
|
||||||
|
WMRealizeWidget(panel->box);
|
||||||
|
|
||||||
showData(panel);
|
showData(panel);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user