mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-06 05:44:11 +01:00
added cback for set button in fontpanel
This commit is contained in:
@@ -31,13 +31,14 @@ Changes since version 0.80.1:
|
|||||||
- Fixed wrlib to not accept too large images (fixes buffer overflow)
|
- Fixed wrlib to not accept too large images (fixes buffer overflow)
|
||||||
- Patched FAQ (David Coe <davidc@debian.org>)
|
- Patched FAQ (David Coe <davidc@debian.org>)
|
||||||
- Fixed bug with resizebars appearing out of nothing when reloading configs
|
- 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
|
- Applied Xinerama patch (after fixes) from (Peter Zijlstra
|
||||||
<a.p.zijlstra@chello.nl>)
|
<a.p.zijlstra@chello.nl>)
|
||||||
- Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings
|
- Added switch to enable/disable antialiased fonts in WPrefs's Expert Settings
|
||||||
panel. (Temporary until the Font Settings panel in WPrefs is finished).
|
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
|
- 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)
|
most once for each font in a fontset (eliminates a possible security exploit)
|
||||||
|
- Added fontpanel callback
|
||||||
|
|
||||||
|
|
||||||
Changes since version 0.80.0:
|
Changes since version 0.80.0:
|
||||||
|
|||||||
@@ -1865,6 +1865,8 @@ void WMShowFontPanel(WMFontPanel *panel);
|
|||||||
|
|
||||||
void WMHideFontPanel(WMFontPanel *panel);
|
void WMHideFontPanel(WMFontPanel *panel);
|
||||||
|
|
||||||
|
void WMSetFontPanelAction(WMFontPanel *panel, WMAction2 *action, void *data);
|
||||||
|
|
||||||
void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
|
void WMSetFontPanelFont(WMFontPanel *panel, WMFont *font);
|
||||||
|
|
||||||
/* you can free the returned string */
|
/* you can free the returned string */
|
||||||
|
|||||||
@@ -10,6 +10,13 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* XXX TODO */
|
||||||
|
char *WMFontPanelFontChangedNotification = "WMFontPanelFontChangedNotification";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct W_FontPanel {
|
typedef struct W_FontPanel {
|
||||||
WMWindow *win;
|
WMWindow *win;
|
||||||
|
|
||||||
@@ -27,6 +34,9 @@ typedef struct W_FontPanel {
|
|||||||
WMTextField *sizT;
|
WMTextField *sizT;
|
||||||
WMList *sizLs;
|
WMList *sizLs;
|
||||||
|
|
||||||
|
WMAction2 *action;
|
||||||
|
void *data;
|
||||||
|
|
||||||
WMButton *revertB;
|
WMButton *revertB;
|
||||||
WMButton *setB;
|
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*
|
WMFontPanel*
|
||||||
WMGetFontPanel(WMScreen *scr)
|
WMGetFontPanel(WMScreen *scr)
|
||||||
{
|
{
|
||||||
@@ -250,11 +280,14 @@ WMGetFontPanel(WMScreen *scr)
|
|||||||
WMResizeWidget(panel->setB, 70, 24);
|
WMResizeWidget(panel->setB, 70, 24);
|
||||||
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
|
WMMoveWidget(panel->setB, 240, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
|
||||||
WMSetButtonText(panel->setB, _("Set"));
|
WMSetButtonText(panel->setB, _("Set"));
|
||||||
|
WMSetButtonAction(panel->setB, setClickedAction, panel);
|
||||||
|
|
||||||
panel->revertB = WMCreateCommandButton(panel->win);
|
panel->revertB = WMCreateCommandButton(panel->win);
|
||||||
WMResizeWidget(panel->revertB, 70, 24);
|
WMResizeWidget(panel->revertB, 70, 24);
|
||||||
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
|
WMMoveWidget(panel->revertB, 80, DEF_HEIGHT - (BUTTON_SPACE_HEIGHT-5));
|
||||||
WMSetButtonText(panel->revertB, _("Revert"));
|
WMSetButtonText(panel->revertB, _("Revert"));
|
||||||
|
WMSetButtonAction(panel->revertB, revertClickedAction, panel);
|
||||||
|
|
||||||
|
|
||||||
WMRealizeWidget(panel->win);
|
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
|
static void
|
||||||
arrangeLowerFrame(FontPanel *panel)
|
arrangeLowerFrame(FontPanel *panel)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user