1 /* FontSimple.c- simplified font configuration panel
3 * WPrefs - Window Maker Preferences Program
5 * Copyright (c) 1998-2004 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include <fontconfig/fontconfig.h>
26 /* workaround for older fontconfig, that doesn't define these constants */
27 #ifndef FC_WEIGHT_NORMAL
29 # define FC_WEIGHT_THIN 10
30 # define FC_WEIGHT_EXTRALIGHT 40
31 # define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
32 # define FC_WEIGHT_REGULAR 80
33 # define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
34 # define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
35 # define FC_WEIGHT_EXTRABOLD 205
36 # define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
37 # define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
39 # define FC_WIDTH "width"
40 # define FC_WIDTH_ULTRACONDENSED 50
41 # define FC_WIDTH_EXTRACONDENSED 63
42 # define FC_WIDTH_CONDENSED 75
43 # define FC_WIDTH_SEMICONDENSED 87
44 # define FC_WIDTH_NORMAL 100
45 # define FC_WIDTH_SEMIEXPANDED 113
46 # define FC_WIDTH_EXPANDED 125
47 # define FC_WIDTH_EXTRAEXPANDED 150
48 # define FC_WIDTH_ULTRAEXPANDED 200
51 #define SAMPLE_TEXT "The Lazy Fox Jumped Ipsum Foobar 1234 - 56789"
70 typedef struct _Panel
{
76 CallbackRec callbacks
;
80 WMPopUpButton
*optionP
;
92 #define ICON_FILE "fonts"
98 { "WindowTitleFont", N_("Window Title") },
99 { "MenuTitleFont", N_("Menu Title") },
100 { "MenuTextFont", N_("Menu Text") },
101 { "IconTitleFont", N_("Icon Title") },
102 { "ClipTitleFont", N_("Clip Title") },
103 { "LargeDisplayFont", N_("Desktop Caption") },
104 { "SystemFont", N_("System Font") },
105 { "BoldSystemFont", N_("Bold System Font")}
108 static const char *standardSizes
[] = {
132 static const struct {
136 { FC_WEIGHT_THIN
, "Thin" },
137 { FC_WEIGHT_EXTRALIGHT
, "ExtraLight" },
138 { FC_WEIGHT_LIGHT
, "Light" },
139 { FC_WEIGHT_NORMAL
, "Normal" },
140 { FC_WEIGHT_MEDIUM
, "" },
141 { FC_WEIGHT_DEMIBOLD
, "DemiBold" },
142 { FC_WEIGHT_BOLD
, "Bold" },
143 { FC_WEIGHT_EXTRABOLD
, "ExtraBold" },
144 { FC_WEIGHT_BLACK
, "Black" }
147 static const struct {
151 { FC_SLANT_ROMAN
, "" },
152 { FC_SLANT_ITALIC
, "Italic" },
153 { FC_SLANT_OBLIQUE
, "Oblique" }
156 static const struct {
160 { FC_WIDTH_ULTRACONDENSED
, "UltraCondensed" },
161 { FC_WIDTH_EXTRACONDENSED
, "ExtraCondensed" },
162 { FC_WIDTH_CONDENSED
, "Condensed" },
163 { FC_WIDTH_SEMICONDENSED
, "SemiCondensed" },
164 { FC_WIDTH_NORMAL
, "" },
165 { FC_WIDTH_SEMIEXPANDED
, "SemiExpanded" },
166 { FC_WIDTH_EXPANDED
, "Expanded" },
167 { FC_WIDTH_EXTRAEXPANDED
, "ExtraExpanded" },
168 { FC_WIDTH_ULTRAEXPANDED
, "UltraExpanded" },
171 static int compare_family(const void *a
, const void *b
)
173 FontFamily
*fa
= (FontFamily
*) a
;
174 FontFamily
*fb
= (FontFamily
*) b
;
175 return strcmp(fa
->name
, fb
->name
);
178 static int compare_styles(const void *a
, const void *b
)
180 FontStyle
*sa
= (FontStyle
*) a
;
181 FontStyle
*sb
= (FontStyle
*) b
;
184 compare
= sa
->weight
- sb
->weight
;
187 compare
= sa
->slant
- sb
->slant
;
190 return (sa
->width
- sb
->width
);
193 static void lookup_available_fonts(_Panel
* panel
)
195 FcPattern
*pat
= FcPatternCreate();
200 os
= FcObjectSetBuild(FC_FAMILY
, FC_WEIGHT
, FC_WIDTH
, FC_SLANT
, NULL
);
202 fonts
= FcFontList(0, pat
, os
);
207 panel
->fonts
= wmalloc(sizeof(FontList
));
208 panel
->fonts
->familyn
= 0;
209 panel
->fonts
->families
= wmalloc(sizeof(FontFamily
) * fonts
->nfont
);
211 for (i
= 0; i
< fonts
->nfont
; i
++) {
213 int weight
, slant
, width
;
216 if (FcPatternGetString(fonts
->fonts
[i
], FC_FAMILY
, 0, (FcChar8
**) & name
) !=
220 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
221 weight
= FC_WEIGHT_MEDIUM
;
223 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WIDTH
, 0, &width
) != FcResultMatch
)
224 width
= FC_WIDTH_NORMAL
;
226 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_SLANT
, 0, &slant
) != FcResultMatch
)
227 slant
= FC_SLANT_ROMAN
;
230 for (j
= 0; j
< panel
->fonts
->familyn
&& found
< 0; j
++)
231 if (strcasecmp(panel
->fonts
->families
[j
].name
, name
) == 0)
235 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup(name
);
236 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
238 family
->styles
= NULL
;
240 family
= panel
->fonts
->families
+ found
;
243 family
->styles
= wrealloc(family
->styles
, sizeof(FontStyle
) * family
->stylen
);
244 family
->styles
[family
->stylen
- 1].weight
= weight
;
245 family
->styles
[family
->stylen
- 1].slant
= slant
;
246 family
->styles
[family
->stylen
- 1].width
= width
;
248 qsort(panel
->fonts
->families
, panel
->fonts
->familyn
, sizeof(FontFamily
), compare_family
);
250 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
251 qsort(panel
->fonts
->families
[i
].styles
, panel
->fonts
->families
[i
].stylen
,
252 sizeof(FontStyle
), compare_styles
);
255 FcFontSetDestroy(fonts
);
258 FcObjectSetDestroy(os
);
260 FcPatternDestroy(pat
);
262 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("sans serif");
263 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
264 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
266 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
267 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
268 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
269 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
270 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
271 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
273 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("serif");
274 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
275 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
277 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
278 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
279 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
280 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
281 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
282 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
285 static char *getSelectedFont(_Panel
* panel
, FcChar8
* curfont
)
292 pat
= FcNameParse(curfont
);
294 pat
= FcPatternCreate();
296 item
= WMGetListSelectedItem(panel
->familyL
);
298 FcPatternDel(pat
, FC_FAMILY
);
299 FcPatternAddString(pat
, FC_FAMILY
, (FcChar8
*) item
->text
);
302 item
= WMGetListSelectedItem(panel
->styleL
);
304 FontStyle
*style
= (FontStyle
*) item
->clientData
;
306 FcPatternDel(pat
, FC_WEIGHT
);
307 FcPatternAddInteger(pat
, FC_WEIGHT
, style
->weight
);
309 FcPatternDel(pat
, FC_WIDTH
);
310 FcPatternAddInteger(pat
, FC_WIDTH
, style
->width
);
312 FcPatternDel(pat
, FC_SLANT
);
313 FcPatternAddInteger(pat
, FC_SLANT
, style
->slant
);
316 item
= WMGetListSelectedItem(panel
->sizeL
);
318 FcPatternDel(pat
, FC_PIXEL_SIZE
);
319 FcPatternAddDouble(pat
, FC_PIXEL_SIZE
, atoi(item
->text
));
322 name
= (char *)FcNameUnparse(pat
);
323 FcPatternDestroy(pat
);
328 static void updateSampleFont(_Panel
* panel
)
330 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
,
331 WMGetPopUpButtonSelectedItem(panel
->optionP
));
332 char *fn
= WMGetMenuItemRepresentedObject(item
);
335 WMFont
*font
= WMCreateFont(WMWidgetScreen(panel
->box
), fn
);
337 WMSetTextFieldFont(panel
->sampleT
, font
);
343 static void selectedFamily(WMWidget
* w
, void *data
)
345 _Panel
*panel
= (_Panel
*) data
;
347 FontStyle
*oldStyle
= NULL
;
350 /* Parameter not used, but tell the compiler that it is ok */
353 item
= WMGetListSelectedItem(panel
->styleL
);
355 oldStyle
= (FontStyle
*) item
->clientData
;
357 item
= WMGetListSelectedItem(panel
->familyL
);
360 FontFamily
*family
= (FontFamily
*) item
->clientData
;
361 int i
, oldi
= 0, oldscore
= 0;
363 WMClearList(panel
->styleL
);
364 for (i
= 0; i
< family
->stylen
; i
++) {
366 const char *weight
= "", *slant
= "", *width
= "";
369 for (j
= 0; j
< wlengthof(fontWeights
); j
++)
370 if (fontWeights
[j
].weight
== family
->styles
[i
].weight
) {
371 weight
= fontWeights
[j
].name
;
374 for (j
= 0; j
< wlengthof(fontWidths
); j
++)
375 if (fontWidths
[j
].width
== family
->styles
[i
].width
) {
376 width
= fontWidths
[j
].name
;
379 for (j
= 0; j
< wlengthof(fontSlants
); j
++)
380 if (fontSlants
[j
].slant
== family
->styles
[i
].slant
) {
381 slant
= fontSlants
[j
].name
;
384 sprintf(buffer
, "%s%s%s%s%s",
385 weight
, *weight
? " " : "", slant
, (*slant
|| *weight
) ? " " : "", width
);
387 strcpy(buffer
, "Roman");
389 item
= WMAddListItem(panel
->styleL
, buffer
);
390 item
->clientData
= family
->styles
+ i
;
395 if (oldStyle
->width
== family
->styles
[i
].width
)
397 if (oldStyle
->weight
== family
->styles
[i
].weight
)
399 if (oldStyle
->slant
== family
->styles
[i
].slant
)
402 if (score
> oldscore
) {
408 WMSelectListItem(panel
->styleL
, oldi
);
411 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
412 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
416 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
417 nfont
= getSelectedFont(panel
, ofont
);
420 WMSetMenuItemRepresentedObject(item
, nfont
);
422 updateSampleFont(panel
);
426 static void selected(WMWidget
* w
, void *data
)
428 _Panel
*panel
= (_Panel
*) data
;
429 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
430 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
434 /* Parameter not used, but tell the compiler that it is ok */
437 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
438 nfont
= getSelectedFont(panel
, ofont
);
442 WMSetMenuItemRepresentedObject(item
, nfont
);
444 updateSampleFont(panel
);
447 static void selectedOption(WMWidget
* w
, void *data
)
449 _Panel
*panel
= (_Panel
*) data
;
450 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
451 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
454 /* Parameter not used, but tell the compiler that it is ok */
457 font
= (char *)WMGetMenuItemRepresentedObject(item
);
461 pat
= FcNameParse((FcChar8
*) font
);
464 int weight
, slant
, width
;
466 int distance
, closest
, found
;
469 FcDefaultSubstitute(pat
);
471 if (FcPatternGetString(pat
, FC_FAMILY
, 0, (FcChar8
**) & name
) != FcResultMatch
)
476 for (i
= 0; i
< WMGetListNumberOfRows(panel
->familyL
); i
++) {
477 WMListItem
*item
= WMGetListItem(panel
->familyL
, i
);
478 FontFamily
*family
= (FontFamily
*) item
->clientData
;
480 if (strcasecmp(family
->name
, name
) == 0) {
482 WMSelectListItem(panel
->familyL
, i
);
483 WMSetListPosition(panel
->familyL
, i
);
488 WMSelectListItem(panel
->familyL
, -1);
489 selectedFamily(panel
->familyL
, panel
);
492 if (FcPatternGetInteger(pat
, FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
493 weight
= FC_WEIGHT_NORMAL
;
494 if (FcPatternGetInteger(pat
, FC_WIDTH
, 0, &width
) != FcResultMatch
)
495 width
= FC_WIDTH_NORMAL
;
496 if (FcPatternGetInteger(pat
, FC_SLANT
, 0, &slant
) != FcResultMatch
)
497 slant
= FC_SLANT_ROMAN
;
499 if (FcPatternGetDouble(pat
, FC_PIXEL_SIZE
, 0, &size
) != FcResultMatch
)
502 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->styleL
); i
++) {
503 WMListItem
*item
= WMGetListItem(panel
->styleL
, i
);
504 FontStyle
*style
= (FontStyle
*) item
->clientData
;
506 distance
= ((abs(style
->weight
- weight
) << 16) +
507 (abs(style
->slant
- slant
) << 8) + (abs(style
->width
- width
)));
509 if (i
== 0 || distance
< closest
) {
513 break; /* perfect match */
517 WMSelectListItem(panel
->styleL
, found
);
518 WMSetListPosition(panel
->styleL
, found
);
520 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->sizeL
); i
++) {
521 WMListItem
*item
= WMGetListItem(panel
->sizeL
, i
);
524 distance
= abs(size
- atoi(item
->text
));
526 if (i
== 0 || distance
< closest
) {
530 break; /* perfect match */
534 WMSelectListItem(panel
->sizeL
, found
);
535 WMSetListPosition(panel
->sizeL
, found
);
537 selected(NULL
, panel
);
539 wwarning("Can't parse font '%s'", font
);
542 updateSampleFont(panel
);
545 static WMLabel
*createListLabel(WMScreen
* scr
, WMWidget
* parent
, const char *text
)
549 WMFont
*boldFont
= WMBoldSystemFontOfSize(scr
, 12);
551 label
= WMCreateLabel(parent
);
552 WMSetLabelFont(label
, boldFont
);
553 WMSetLabelText(label
, text
);
554 WMSetLabelRelief(label
, WRSunken
);
555 WMSetLabelTextAlignment(label
, WACenter
);
556 color
= WMDarkGrayColor(scr
);
557 WMSetWidgetBackgroundColor(label
, color
);
558 WMReleaseColor(color
);
559 color
= WMWhiteColor(scr
);
560 WMSetLabelTextColor(label
, color
);
561 WMReleaseColor(color
);
563 WMReleaseFont(boldFont
);
568 static void showData(_Panel
* panel
)
573 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
576 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
578 ofont
= WMGetMenuItemRepresentedObject(item
);
582 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0 ||
583 strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0) {
585 WMUserDefaults
*defaults
;
587 path
= wdefaultspathfordomain("WMGLOBAL");
588 defaults
= WMGetDefaultsFromPath(path
);
590 font
= WMGetUDStringForKey(defaults
,
591 fontOptions
[i
].option
);
593 font
= GetStringForKey(fontOptions
[i
].option
);
596 font
= wstrdup(font
);
597 WMSetMenuItemRepresentedObject(item
, font
);
600 WMSetPopUpButtonSelectedItem(panel
->optionP
, 0);
601 selectedOption(panel
->optionP
, panel
);
604 static void storeData(_Panel
* panel
)
608 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
611 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
613 font
= WMGetMenuItemRepresentedObject(item
);
615 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0 ||
616 strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0) {
618 WMUserDefaults
*defaults
;
620 path
= wdefaultspathfordomain("WMGLOBAL");
621 defaults
= WMGetDefaultsFromPath(path
);
623 WMSetUDStringForKey(defaults
,
625 fontOptions
[i
].option
);
626 WMSaveUserDefaults(defaults
);
628 SetStringForKey(font
, fontOptions
[i
].option
);
634 static void createPanel(Panel
* p
)
636 _Panel
*panel
= (_Panel
*) p
;
637 WMScreen
*scr
= WMWidgetScreen(panel
->parent
);
642 lookup_available_fonts(panel
);
644 panel
->box
= WMCreateBox(panel
->parent
);
645 WMSetViewExpandsToParent(WMWidgetView(panel
->box
), 5, 2, 5, 5);
646 WMSetBoxHorizontal(panel
->box
, False
);
647 WMSetBoxBorderWidth(panel
->box
, 8);
648 WMMapWidget(panel
->box
);
650 hbox
= WMCreateBox(panel
->box
);
651 WMSetBoxHorizontal(hbox
, True
);
652 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), False
, True
, 40, 22, 8);
654 vbox
= WMCreateBox(hbox
);
655 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 130, 0, 10);
656 WMSetBoxHorizontal(vbox
, False
);
657 panel
->optionP
= WMCreatePopUpButton(vbox
);
658 WMAddBoxSubviewAtEnd(vbox
, WMWidgetView(panel
->optionP
), False
, True
, 20, 0, 8);
659 for (i
= 0; i
< wlengthof(fontOptions
); i
++)
660 WMAddPopUpButtonItem(panel
->optionP
, _(fontOptions
[i
].label
));
661 WMSetPopUpButtonAction(panel
->optionP
, selectedOption
, panel
);
663 label
= WMCreateLabel(hbox
);
664 WMSetLabelText(label
, _("Sample Text"));
665 WMSetLabelTextAlignment(label
, WARight
);
666 WMAddBoxSubview(hbox
, WMWidgetView(label
), False
, True
, 80, 0, 2);
668 panel
->sampleT
= WMCreateTextField(hbox
);
669 WMSetViewExpandsToParent(WMWidgetView(panel
->sampleT
), 10, 18, 10, 10);
670 WMSetTextFieldText(panel
->sampleT
, SAMPLE_TEXT
);
671 WMAddBoxSubview(hbox
, WMWidgetView(panel
->sampleT
), True
, True
, 60, 0, 0);
673 hbox
= WMCreateBox(panel
->box
);
674 WMSetBoxHorizontal(hbox
, True
);
675 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), True
, True
, 100, 0, 2);
677 vbox
= WMCreateBox(hbox
);
678 WMSetBoxHorizontal(vbox
, False
);
679 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 240, 20, 4);
681 label
= createListLabel(scr
, vbox
, _("Family"));
682 WMAddBoxSubview(vbox
, WMWidgetView(label
), False
, True
, 20, 0, 2);
685 panel
->familyL
= WMCreateList(vbox
);
686 WMAddBoxSubview(vbox
, WMWidgetView(panel
->familyL
), True
, True
, 0, 0, 0);
689 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
690 item
= WMAddListItem(panel
->familyL
, panel
->fonts
->families
[i
].name
);
691 item
->clientData
= panel
->fonts
->families
+ i
;
694 WMAddListItem(panel
->familyL
, "sans serif");
696 WMSetListAction(panel
->familyL
, selectedFamily
, panel
);
698 vbox
= WMCreateBox(hbox
);
699 WMSetBoxHorizontal(vbox
, False
);
700 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), True
, True
, 10, 0, 0);
703 WMBox
*box
= WMCreateBox(vbox
);
704 WMSetBoxHorizontal(box
, True
);
705 WMAddBoxSubview(vbox
, WMWidgetView(box
), False
, True
, 20, 0, 2);
707 label
= createListLabel(scr
, box
, _("Style"));
708 WMAddBoxSubview(box
, WMWidgetView(label
), True
, True
, 20, 0, 4);
710 label
= createListLabel(scr
, box
, _("Size"));
711 WMAddBoxSubview(box
, WMWidgetView(label
), False
, True
, 60, 0, 0);
713 box
= WMCreateBox(vbox
);
714 WMSetBoxHorizontal(box
, True
);
715 WMAddBoxSubview(vbox
, WMWidgetView(box
), True
, True
, 20, 0, 0);
717 panel
->styleL
= WMCreateList(box
);
718 WMAddBoxSubview(box
, WMWidgetView(panel
->styleL
), True
, True
, 0, 0, 4);
719 WMSetListAction(panel
->styleL
, selected
, panel
);
721 panel
->sizeL
= WMCreateList(box
);
722 WMAddBoxSubview(box
, WMWidgetView(panel
->sizeL
), False
, True
, 60, 0, 0);
723 for (i
= 0; standardSizes
[i
]; i
++) {
724 WMAddListItem(panel
->sizeL
, standardSizes
[i
]);
726 WMSetListAction(panel
->sizeL
, selected
, panel
);
729 WMMapSubwidgets(panel
->box
);
730 WMMapWidget(panel
->box
);
731 WMRealizeWidget(panel
->box
);
736 Panel
*InitFontSimple(WMWidget
*parent
)
740 panel
= wmalloc(sizeof(_Panel
));
742 panel
->sectionName
= _("Font Configuration");
744 panel
->description
= _("Configure fonts for Window Maker titlebars, menus etc.");
746 panel
->parent
= parent
;
748 panel
->callbacks
.createWidgets
= createPanel
;
749 panel
->callbacks
.updateDomain
= storeData
;
751 AddSection(panel
, ICON_FILE
);