mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
WPrefs: moved the titles of Clip Delay frames to an array
As the code is already treating these frames as an array, it is a good idea to do the same for their titles so it is possible to reuse its size at convenient places to make the code safer. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
48ce9d046e
commit
68e550b924
@@ -22,6 +22,11 @@
|
|||||||
#include "WPrefs.h"
|
#include "WPrefs.h"
|
||||||
|
|
||||||
|
|
||||||
|
static const char *const clip_delay_frame_titles[] = {
|
||||||
|
N_("Clip autocollapsing delays"),
|
||||||
|
N_("Clip autoraising delays")
|
||||||
|
};
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *key;
|
const char *key;
|
||||||
const char *string;
|
const char *string;
|
||||||
@@ -54,7 +59,7 @@ typedef struct _Panel {
|
|||||||
|
|
||||||
WMWidget *parent;
|
WMWidget *parent;
|
||||||
|
|
||||||
WMFrame *autoDelayF[2];
|
WMFrame *autoDelayF[wlengthof_nocheck(clip_delay_frame_titles)];
|
||||||
WMLabel *autoDelayL[wlengthof_nocheck(auto_delay)];
|
WMLabel *autoDelayL[wlengthof_nocheck(auto_delay)];
|
||||||
WMButton *autoDelayB[wlengthof_nocheck(auto_delay)][wlengthof_nocheck(autoDelayPresetValues)];
|
WMButton *autoDelayB[wlengthof_nocheck(auto_delay)][wlengthof_nocheck(autoDelayPresetValues)];
|
||||||
WMTextField *autoDelayT[wlengthof_nocheck(auto_delay)];
|
WMTextField *autoDelayT[wlengthof_nocheck(auto_delay)];
|
||||||
@@ -170,15 +175,12 @@ static void createPanel(Panel *p)
|
|||||||
buf1 = wmalloc(strlen(DELAY_ICON) + 1);
|
buf1 = wmalloc(strlen(DELAY_ICON) + 1);
|
||||||
buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);
|
buf2 = wmalloc(strlen(DELAY_ICON_S) + 1);
|
||||||
|
|
||||||
for (k = 0; k < 2; k++)
|
for (k = 0; k < wlengthof(clip_delay_frame_titles); k++)
|
||||||
{
|
{
|
||||||
panel->autoDelayF[k] = WMCreateFrame(panel->box);
|
panel->autoDelayF[k] = WMCreateFrame(panel->box);
|
||||||
WMResizeWidget(panel->autoDelayF[k], 370, 100);
|
WMResizeWidget(panel->autoDelayF[k], 370, 100);
|
||||||
WMMoveWidget(panel->autoDelayF[k], 15, 10 + k * 110);
|
WMMoveWidget(panel->autoDelayF[k], 15, 10 + k * 110);
|
||||||
if (k == 0)
|
WMSetFrameTitle(panel->autoDelayF[k], _(clip_delay_frame_titles[k]));
|
||||||
WMSetFrameTitle(panel->autoDelayF[k], _("Clip autocollapsing delays"));
|
|
||||||
else
|
|
||||||
WMSetFrameTitle(panel->autoDelayF[k], _("Clip autoraising delays"));
|
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user