1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-09 07:14:18 +01:00

added cback for set button in fontpanel

This commit is contained in:
kojima
2002-12-04 15:40:32 +00:00
parent 90e8cfc5b8
commit 55d37178a0
3 changed files with 48 additions and 1 deletions

View File

@@ -31,13 +31,14 @@ Changes since version 0.80.1:
- Fixed wrlib to not accept too large images (fixes buffer overflow)
- Patched FAQ (David Coe <davidc@debian.org>)
- Fixed bug with resizebars appearing out of nothing when reloading configs
- Fixed sloppy focus bug (Pawel S. Veselov <pv76716@druid.SFBay.Sun.COM>)
- Fixed sloppy focus bug (Pawel S. Veselov <Pawel.Veselov@Sun.COM>)
- Applied Xinerama patch (after fixes) from (Peter Zijlstra
<a.p.zijlstra@chello.nl>)
- Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings
panel. (Temporary until the Font Settings panel in WPrefs is finished).
- Added a check that only %d is used in a font specification in WMGLOBAL and at
most once for each font in a fontset (eliminates a possible security exploit)
- Added fontpanel callback
Changes since version 0.80.0:

View File

@@ -1865,6 +1865,8 @@ void WMShowFontPanel(WMFontPanel *panel);
void WMHideFontPanel(WMFontPanel *panel);
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
/* you can free the returned string */

View File

@@ -10,6 +10,13 @@
#include <string.h>
/* XXX TODO */
char *WMFontPanelFontChangedNotification = "WMFontPanelFontChangedNotification";
typedef struct W_FontPanel {
WMWindow *win;
@@ -27,6 +34,9 @@ typedef struct W_FontPanel {
WMTextField *sizT;
WMList *sizLs;
WMAction2 *action;
void *data;
WMButton *revertB;
WMButton *setB;
@@ -150,6 +160,26 @@ closeWindow(WMWidget *w, void *data)
static void
setClickedAction(WMWidget *w, void *data)
{
FontPanel *panel = (FontPanel*)data;
if (panel->action)
(*panel->action)(panel, panel->data);
}
static void
revertClickedAction(WMWidget *w, void *data)
{
FontPanel *panel = (FontPanel*)data;
/* XXX TODO */
}
WMFontPanel*
WMGetFontPanel(WMScreen *scr)
{
@@ -250,11 +280,14 @@ WMGetFontPanel(WMScreen *scr)
WMResizeWidget(panel->setB, 70, 24);
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->setB, _("Set"));
WMSetButtonAction(panel->setB, setClickedAction, panel);
panel->revertB = WMCreateCommandButton(panel->win);
WMResizeWidget(panel->revertB, 70, 24);
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
WMSetButtonText(panel->revertB, _("Revert"));
WMSetButtonAction(panel->revertB, revertClickedAction, panel);
WMRealizeWidget(panel->win);
@@ -350,6 +383,17 @@ WMGetFontPanelFontName(WMFontPanel *panel)
void
WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data)
{
panel->action = action;
panel->actionData = data;
}
static void
arrangeLowerFrame(FontPanel *panel)
{