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>
27 /* workaround for older fontconfig, that doesn't define these constants */
28 #ifndef FC_WEIGHT_NORMAL
30 # define FC_WEIGHT_THIN 10
31 # define FC_WEIGHT_EXTRALIGHT 40
32 # define FC_WEIGHT_ULTRALIGHT FC_WEIGHT_EXTRALIGHT
33 # define FC_WEIGHT_REGULAR 80
34 # define FC_WEIGHT_NORMAL FC_WEIGHT_REGULAR
35 # define FC_WEIGHT_SEMIBOLD FC_WEIGHT_DEMIBOLD
36 # define FC_WEIGHT_EXTRABOLD 205
37 # define FC_WEIGHT_ULTRABOLD FC_WEIGHT_EXTRABOLD
38 # define FC_WEIGHT_HEAVY FC_WEIGHT_BLACK
40 # define FC_WIDTH "width"
41 # define FC_WIDTH_ULTRACONDENSED 50
42 # define FC_WIDTH_EXTRACONDENSED 63
43 # define FC_WIDTH_CONDENSED 75
44 # define FC_WIDTH_SEMICONDENSED 87
45 # define FC_WIDTH_NORMAL 100
46 # define FC_WIDTH_SEMIEXPANDED 113
47 # define FC_WIDTH_EXPANDED 125
48 # define FC_WIDTH_EXTRAEXPANDED 150
49 # define FC_WIDTH_ULTRAEXPANDED 200
52 #define SAMPLE_TEXT "The Lazy Fox Jumped Ipsum Foobar 1234 - 56789"
71 typedef struct _Panel
{
77 CallbackRec callbacks
;
81 WMPopUpButton
*optionP
;
93 #define ICON_FILE "fonts"
99 { "WindowTitleFont", N_("Window Title") },
100 { "MenuTitleFont", N_("Menu Title") },
101 { "MenuTextFont", N_("Menu Text") },
102 { "IconTitleFont", N_("Icon Title") },
103 { "ClipTitleFont", N_("Clip Title") },
104 { "LargeDisplayFont", N_("Desktop Caption") },
105 { "SystemFont", N_("System Font") },
106 { "BoldSystemFont", N_("Bold System Font")}
109 static const char *standardSizes
[] = {
133 static const struct {
137 { FC_WEIGHT_THIN
, "Thin" },
138 { FC_WEIGHT_EXTRALIGHT
, "ExtraLight" },
139 { FC_WEIGHT_LIGHT
, "Light" },
140 { FC_WEIGHT_NORMAL
, "Normal" },
141 { FC_WEIGHT_MEDIUM
, "" },
142 { FC_WEIGHT_DEMIBOLD
, "DemiBold" },
143 { FC_WEIGHT_BOLD
, "Bold" },
144 { FC_WEIGHT_EXTRABOLD
, "ExtraBold" },
145 { FC_WEIGHT_BLACK
, "Black" }
148 static const struct {
152 { FC_SLANT_ROMAN
, "" },
153 { FC_SLANT_ITALIC
, "Italic" },
154 { FC_SLANT_OBLIQUE
, "Oblique" }
157 static const struct {
161 { FC_WIDTH_ULTRACONDENSED
, "UltraCondensed" },
162 { FC_WIDTH_EXTRACONDENSED
, "ExtraCondensed" },
163 { FC_WIDTH_CONDENSED
, "Condensed" },
164 { FC_WIDTH_SEMICONDENSED
, "SemiCondensed" },
165 { FC_WIDTH_NORMAL
, "" },
166 { FC_WIDTH_SEMIEXPANDED
, "SemiExpanded" },
167 { FC_WIDTH_EXPANDED
, "Expanded" },
168 { FC_WIDTH_EXTRAEXPANDED
, "ExtraExpanded" },
169 { FC_WIDTH_ULTRAEXPANDED
, "UltraExpanded" },
172 static int compare_family(const void *a
, const void *b
)
174 FontFamily
*fa
= (FontFamily
*) a
;
175 FontFamily
*fb
= (FontFamily
*) b
;
176 return strcmp(fa
->name
, fb
->name
);
179 static int compare_styles(const void *a
, const void *b
)
181 FontStyle
*sa
= (FontStyle
*) a
;
182 FontStyle
*sb
= (FontStyle
*) b
;
185 compare
= sa
->weight
- sb
->weight
;
188 compare
= sa
->slant
- sb
->slant
;
191 return (sa
->width
- sb
->width
);
194 static void lookup_available_fonts(_Panel
* panel
)
196 FcPattern
*pat
= FcPatternCreate();
201 os
= FcObjectSetBuild(FC_FAMILY
, FC_WEIGHT
, FC_WIDTH
, FC_SLANT
, NULL
);
203 fonts
= FcFontList(0, pat
, os
);
208 panel
->fonts
= wmalloc(sizeof(FontList
));
209 panel
->fonts
->familyn
= 0;
210 panel
->fonts
->families
= wmalloc(sizeof(FontFamily
) * fonts
->nfont
);
212 for (i
= 0; i
< fonts
->nfont
; i
++) {
214 int weight
, slant
, width
;
217 if (FcPatternGetString(fonts
->fonts
[i
], FC_FAMILY
, 0, (FcChar8
**) & name
) !=
221 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
222 weight
= FC_WEIGHT_MEDIUM
;
224 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_WIDTH
, 0, &width
) != FcResultMatch
)
225 width
= FC_WIDTH_NORMAL
;
227 if (FcPatternGetInteger(fonts
->fonts
[i
], FC_SLANT
, 0, &slant
) != FcResultMatch
)
228 slant
= FC_SLANT_ROMAN
;
231 for (j
= 0; j
< panel
->fonts
->familyn
&& found
< 0; j
++)
232 if (strcasecmp(panel
->fonts
->families
[j
].name
, name
) == 0)
236 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup(name
);
237 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
239 family
->styles
= NULL
;
241 family
= panel
->fonts
->families
+ found
;
244 family
->styles
= wrealloc(family
->styles
, sizeof(FontStyle
) * family
->stylen
);
245 family
->styles
[family
->stylen
- 1].weight
= weight
;
246 family
->styles
[family
->stylen
- 1].slant
= slant
;
247 family
->styles
[family
->stylen
- 1].width
= width
;
249 qsort(panel
->fonts
->families
, panel
->fonts
->familyn
, sizeof(FontFamily
), compare_family
);
251 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
252 qsort(panel
->fonts
->families
[i
].styles
, panel
->fonts
->families
[i
].stylen
,
253 sizeof(FontStyle
), compare_styles
);
256 FcFontSetDestroy(fonts
);
259 FcObjectSetDestroy(os
);
261 FcPatternDestroy(pat
);
263 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("sans serif");
264 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
265 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
267 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
268 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
269 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
270 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
271 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
272 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
274 panel
->fonts
->families
[panel
->fonts
->familyn
++].name
= wstrdup("serif");
275 family
= panel
->fonts
->families
+ panel
->fonts
->familyn
- 1;
276 family
->styles
= wmalloc(sizeof(FontStyle
) * 2);
278 family
->styles
[0].weight
= FC_WEIGHT_MEDIUM
;
279 family
->styles
[0].slant
= FC_SLANT_ROMAN
;
280 family
->styles
[0].width
= FC_WIDTH_NORMAL
;
281 family
->styles
[1].weight
= FC_WEIGHT_BOLD
;
282 family
->styles
[1].slant
= FC_SLANT_ROMAN
;
283 family
->styles
[1].width
= FC_WIDTH_NORMAL
;
286 static char *getSelectedFont(_Panel
* panel
, FcChar8
* curfont
)
293 pat
= FcNameParse(curfont
);
295 pat
= FcPatternCreate();
297 item
= WMGetListSelectedItem(panel
->familyL
);
299 FcPatternDel(pat
, FC_FAMILY
);
300 FcPatternAddString(pat
, FC_FAMILY
, (FcChar8
*) item
->text
);
303 item
= WMGetListSelectedItem(panel
->styleL
);
305 FontStyle
*style
= (FontStyle
*) item
->clientData
;
307 FcPatternDel(pat
, FC_WEIGHT
);
308 FcPatternAddInteger(pat
, FC_WEIGHT
, style
->weight
);
310 FcPatternDel(pat
, FC_WIDTH
);
311 FcPatternAddInteger(pat
, FC_WIDTH
, style
->width
);
313 FcPatternDel(pat
, FC_SLANT
);
314 FcPatternAddInteger(pat
, FC_SLANT
, style
->slant
);
317 item
= WMGetListSelectedItem(panel
->sizeL
);
319 FcPatternDel(pat
, FC_PIXEL_SIZE
);
320 FcPatternAddDouble(pat
, FC_PIXEL_SIZE
, atoi(item
->text
));
323 name
= (char *)FcNameUnparse(pat
);
324 FcPatternDestroy(pat
);
329 static void updateSampleFont(_Panel
* panel
)
331 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
,
332 WMGetPopUpButtonSelectedItem(panel
->optionP
));
333 char *fn
= WMGetMenuItemRepresentedObject(item
);
336 WMFont
*font
= WMCreateFont(WMWidgetScreen(panel
->box
), fn
);
338 WMSetTextFieldFont(panel
->sampleT
, font
);
344 static void selectedFamily(WMWidget
* w
, void *data
)
346 _Panel
*panel
= (_Panel
*) data
;
348 FontStyle
*oldStyle
= NULL
;
351 /* Parameter not used, but tell the compiler that it is ok */
354 item
= WMGetListSelectedItem(panel
->styleL
);
356 oldStyle
= (FontStyle
*) item
->clientData
;
358 item
= WMGetListSelectedItem(panel
->familyL
);
361 FontFamily
*family
= (FontFamily
*) item
->clientData
;
362 int i
, oldi
= 0, oldscore
= 0;
364 WMClearList(panel
->styleL
);
365 for (i
= 0; i
< family
->stylen
; i
++) {
367 const char *weight
= "", *slant
= "", *width
= "";
370 for (j
= 0; j
< wlengthof(fontWeights
); j
++)
371 if (fontWeights
[j
].weight
== family
->styles
[i
].weight
) {
372 weight
= fontWeights
[j
].name
;
375 for (j
= 0; j
< wlengthof(fontWidths
); j
++)
376 if (fontWidths
[j
].width
== family
->styles
[i
].width
) {
377 width
= fontWidths
[j
].name
;
380 for (j
= 0; j
< wlengthof(fontSlants
); j
++)
381 if (fontSlants
[j
].slant
== family
->styles
[i
].slant
) {
382 slant
= fontSlants
[j
].name
;
385 sprintf(buffer
, "%s%s%s%s%s",
386 weight
, *weight
? " " : "", slant
, (*slant
|| *weight
) ? " " : "", width
);
388 strcpy(buffer
, "Roman");
390 item
= WMAddListItem(panel
->styleL
, buffer
);
391 item
->clientData
= family
->styles
+ i
;
396 if (oldStyle
->width
== family
->styles
[i
].width
)
398 if (oldStyle
->weight
== family
->styles
[i
].weight
)
400 if (oldStyle
->slant
== family
->styles
[i
].slant
)
403 if (score
> oldscore
) {
409 WMSelectListItem(panel
->styleL
, oldi
);
412 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
413 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
417 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
418 nfont
= getSelectedFont(panel
, ofont
);
421 WMSetMenuItemRepresentedObject(item
, nfont
);
423 updateSampleFont(panel
);
427 static void selected(WMWidget
* w
, void *data
)
429 _Panel
*panel
= (_Panel
*) data
;
430 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
431 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
435 /* Parameter not used, but tell the compiler that it is ok */
438 ofont
= (FcChar8
*) WMGetMenuItemRepresentedObject(item
);
439 nfont
= getSelectedFont(panel
, ofont
);
443 WMSetMenuItemRepresentedObject(item
, nfont
);
445 updateSampleFont(panel
);
448 static void selectedOption(WMWidget
* w
, void *data
)
450 _Panel
*panel
= (_Panel
*) data
;
451 int index
= WMGetPopUpButtonSelectedItem(panel
->optionP
);
452 WMMenuItem
*item
= WMGetPopUpButtonMenuItem(panel
->optionP
, index
);
455 /* Parameter not used, but tell the compiler that it is ok */
458 font
= (char *)WMGetMenuItemRepresentedObject(item
);
462 pat
= FcNameParse((FcChar8
*) font
);
465 int weight
, slant
, width
;
467 int distance
, closest
, found
;
470 FcDefaultSubstitute(pat
);
472 if (FcPatternGetString(pat
, FC_FAMILY
, 0, (FcChar8
**) & name
) != FcResultMatch
)
477 for (i
= 0; i
< WMGetListNumberOfRows(panel
->familyL
); i
++) {
478 WMListItem
*item
= WMGetListItem(panel
->familyL
, i
);
479 FontFamily
*family
= (FontFamily
*) item
->clientData
;
481 if (strcasecmp(family
->name
, name
) == 0) {
483 WMSelectListItem(panel
->familyL
, i
);
484 WMSetListPosition(panel
->familyL
, i
);
489 WMSelectListItem(panel
->familyL
, -1);
490 selectedFamily(panel
->familyL
, panel
);
493 if (FcPatternGetInteger(pat
, FC_WEIGHT
, 0, &weight
) != FcResultMatch
)
494 weight
= FC_WEIGHT_NORMAL
;
495 if (FcPatternGetInteger(pat
, FC_WIDTH
, 0, &width
) != FcResultMatch
)
496 width
= FC_WIDTH_NORMAL
;
497 if (FcPatternGetInteger(pat
, FC_SLANT
, 0, &slant
) != FcResultMatch
)
498 slant
= FC_SLANT_ROMAN
;
500 if (FcPatternGetDouble(pat
, FC_PIXEL_SIZE
, 0, &size
) != FcResultMatch
)
503 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->styleL
); i
++) {
504 WMListItem
*item
= WMGetListItem(panel
->styleL
, i
);
505 FontStyle
*style
= (FontStyle
*) item
->clientData
;
507 distance
= ((abs(style
->weight
- weight
) << 16) +
508 (abs(style
->slant
- slant
) << 8) + (abs(style
->width
- width
)));
510 if (i
== 0 || distance
< closest
) {
514 break; /* perfect match */
518 WMSelectListItem(panel
->styleL
, found
);
519 WMSetListPosition(panel
->styleL
, found
);
521 for (i
= 0, found
= 0, closest
= 0; i
< WMGetListNumberOfRows(panel
->sizeL
); i
++) {
522 WMListItem
*item
= WMGetListItem(panel
->sizeL
, i
);
525 distance
= fabs(size
- atoi(item
->text
));
527 if (i
== 0 || distance
< closest
) {
531 break; /* perfect match */
535 WMSelectListItem(panel
->sizeL
, found
);
536 WMSetListPosition(panel
->sizeL
, found
);
538 selected(NULL
, panel
);
540 wwarning("Can't parse font '%s'", font
);
543 updateSampleFont(panel
);
546 static WMLabel
*createListLabel(WMScreen
* scr
, WMWidget
* parent
, const char *text
)
550 WMFont
*boldFont
= WMBoldSystemFontOfSize(scr
, 12);
552 label
= WMCreateLabel(parent
);
553 WMSetLabelFont(label
, boldFont
);
554 WMSetLabelText(label
, text
);
555 WMSetLabelRelief(label
, WRSunken
);
556 WMSetLabelTextAlignment(label
, WACenter
);
557 color
= WMDarkGrayColor(scr
);
558 WMSetWidgetBackgroundColor(label
, color
);
559 WMReleaseColor(color
);
560 color
= WMWhiteColor(scr
);
561 WMSetLabelTextColor(label
, color
);
562 WMReleaseColor(color
);
564 WMReleaseFont(boldFont
);
569 static void showData(_Panel
* panel
)
575 scr
= WMWidgetScreen(panel
->parent
);
577 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
580 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
582 ofont
= WMGetMenuItemRepresentedObject(item
);
586 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0)
587 font
= WMGetFontName(WMDefaultSystemFont(scr
));
588 else if (strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0)
589 font
= WMGetFontName(WMDefaultBoldSystemFont(scr
));
591 font
= GetStringForKey(fontOptions
[i
].option
);
593 font
= wstrdup(font
);
594 WMSetMenuItemRepresentedObject(item
, font
);
597 WMSetPopUpButtonSelectedItem(panel
->optionP
, 0);
598 selectedOption(panel
->optionP
, panel
);
601 static void storeData(_Panel
* panel
)
605 for (i
= 0; i
< WMGetPopUpButtonNumberOfItems(panel
->optionP
); i
++) {
608 item
= WMGetPopUpButtonMenuItem(panel
->optionP
, i
);
610 font
= WMGetMenuItemRepresentedObject(item
);
612 if (strcmp(fontOptions
[i
].option
, "SystemFont") == 0 ||
613 strcmp(fontOptions
[i
].option
, "BoldSystemFont") == 0) {
615 WMUserDefaults
*defaults
;
617 path
= wdefaultspathfordomain("WMGLOBAL");
618 defaults
= WMGetDefaultsFromPath(path
);
620 WMSetUDStringForKey(defaults
,
622 fontOptions
[i
].option
);
623 WMSaveUserDefaults(defaults
);
625 SetStringForKey(font
, fontOptions
[i
].option
);
631 static void createPanel(Panel
* p
)
633 _Panel
*panel
= (_Panel
*) p
;
634 WMScreen
*scr
= WMWidgetScreen(panel
->parent
);
639 lookup_available_fonts(panel
);
641 panel
->box
= WMCreateBox(panel
->parent
);
642 WMSetViewExpandsToParent(WMWidgetView(panel
->box
), 5, 2, 5, 5);
643 WMSetBoxHorizontal(panel
->box
, False
);
644 WMSetBoxBorderWidth(panel
->box
, 8);
645 WMMapWidget(panel
->box
);
647 hbox
= WMCreateBox(panel
->box
);
648 WMSetBoxHorizontal(hbox
, True
);
649 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), False
, True
, 40, 22, 8);
651 vbox
= WMCreateBox(hbox
);
652 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 130, 0, 10);
653 WMSetBoxHorizontal(vbox
, False
);
654 panel
->optionP
= WMCreatePopUpButton(vbox
);
655 WMAddBoxSubviewAtEnd(vbox
, WMWidgetView(panel
->optionP
), False
, True
, 20, 0, 8);
656 for (i
= 0; i
< wlengthof(fontOptions
); i
++)
657 WMAddPopUpButtonItem(panel
->optionP
, _(fontOptions
[i
].label
));
658 WMSetPopUpButtonAction(panel
->optionP
, selectedOption
, panel
);
660 label
= WMCreateLabel(hbox
);
661 WMSetLabelText(label
, _("Sample Text"));
662 WMSetLabelTextAlignment(label
, WARight
);
663 WMAddBoxSubview(hbox
, WMWidgetView(label
), False
, True
, 80, 0, 2);
665 panel
->sampleT
= WMCreateTextField(hbox
);
666 WMSetViewExpandsToParent(WMWidgetView(panel
->sampleT
), 10, 18, 10, 10);
667 WMSetTextFieldText(panel
->sampleT
, SAMPLE_TEXT
);
668 WMAddBoxSubview(hbox
, WMWidgetView(panel
->sampleT
), True
, True
, 60, 0, 0);
670 hbox
= WMCreateBox(panel
->box
);
671 WMSetBoxHorizontal(hbox
, True
);
672 WMAddBoxSubview(panel
->box
, WMWidgetView(hbox
), True
, True
, 100, 0, 2);
674 vbox
= WMCreateBox(hbox
);
675 WMSetBoxHorizontal(vbox
, False
);
676 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), False
, True
, 240, 20, 4);
678 label
= createListLabel(scr
, vbox
, _("Family"));
679 WMAddBoxSubview(vbox
, WMWidgetView(label
), False
, True
, 20, 0, 2);
682 panel
->familyL
= WMCreateList(vbox
);
683 WMAddBoxSubview(vbox
, WMWidgetView(panel
->familyL
), True
, True
, 0, 0, 0);
686 for (i
= 0; i
< panel
->fonts
->familyn
; i
++) {
687 item
= WMAddListItem(panel
->familyL
, panel
->fonts
->families
[i
].name
);
688 item
->clientData
= panel
->fonts
->families
+ i
;
691 WMAddListItem(panel
->familyL
, "sans serif");
693 WMSetListAction(panel
->familyL
, selectedFamily
, panel
);
695 vbox
= WMCreateBox(hbox
);
696 WMSetBoxHorizontal(vbox
, False
);
697 WMAddBoxSubview(hbox
, WMWidgetView(vbox
), True
, True
, 10, 0, 0);
700 WMBox
*box
= WMCreateBox(vbox
);
701 WMSetBoxHorizontal(box
, True
);
702 WMAddBoxSubview(vbox
, WMWidgetView(box
), False
, True
, 20, 0, 2);
704 label
= createListLabel(scr
, box
, _("Style"));
705 WMAddBoxSubview(box
, WMWidgetView(label
), True
, True
, 20, 0, 4);
707 label
= createListLabel(scr
, box
, _("Size"));
708 WMAddBoxSubview(box
, WMWidgetView(label
), False
, True
, 60, 0, 0);
710 box
= WMCreateBox(vbox
);
711 WMSetBoxHorizontal(box
, True
);
712 WMAddBoxSubview(vbox
, WMWidgetView(box
), True
, True
, 20, 0, 0);
714 panel
->styleL
= WMCreateList(box
);
715 WMAddBoxSubview(box
, WMWidgetView(panel
->styleL
), True
, True
, 0, 0, 4);
716 WMSetListAction(panel
->styleL
, selected
, panel
);
718 panel
->sizeL
= WMCreateList(box
);
719 WMAddBoxSubview(box
, WMWidgetView(panel
->sizeL
), False
, True
, 60, 0, 0);
720 for (i
= 0; standardSizes
[i
]; i
++) {
721 WMAddListItem(panel
->sizeL
, standardSizes
[i
]);
723 WMSetListAction(panel
->sizeL
, selected
, panel
);
726 WMMapSubwidgets(panel
->box
);
727 WMMapWidget(panel
->box
);
728 WMRealizeWidget(panel
->box
);
733 Panel
*InitFontSimple(WMWidget
*parent
)
737 panel
= wmalloc(sizeof(_Panel
));
739 panel
->sectionName
= _("Font Configuration");
741 panel
->description
= _("Configure fonts for Window Maker titlebars, menus etc.");
743 panel
->parent
= parent
;
745 panel
->callbacks
.createWidgets
= createPanel
;
746 panel
->callbacks
.updateDomain
= storeData
;
748 AddSection(panel
, ICON_FILE
);