aligned SliderWidget parameter default to other defaults

This commit is contained in:
thrust26 2020-01-11 13:02:51 +01:00
parent a97cf0ba89
commit 4f9d554a5f
4 changed files with 10 additions and 11 deletions

View File

@ -137,8 +137,7 @@ GameInfoDialog::GameInfoDialog(
ypos += lineHeight + VGAP;
t = new StaticTextWidget(myTab, font, HBORDER, ypos + 1, "V-Center ");
myVCenter = new SliderWidget(myTab, font, t->getRight() + 2, ypos, "",
0, kVCenterChanged, 7 * fontWidth, "px",
SliderWidget::DEF_LBL_GAP, true);
0, kVCenterChanged, 7 * fontWidth, "px", 0, true);
myVCenter->setMinValue(TIAConstants::minVcenter);
myVCenter->setMaxValue(TIAConstants::maxVcenter);

View File

@ -138,8 +138,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
// Aspect ratio (NTSC mode)
myAdjustScanlinesNTSC =
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
"NTSC scanlines adjust ", lwidth, 0,
fontWidth * 4, "", SliderWidget::DEF_LBL_GAP, true);
"NTSC scanlines adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
myAdjustScanlinesNTSC->setMinValue(-25); myAdjustScanlinesNTSC->setMaxValue(25);
myAdjustScanlinesNTSC->setTickmarkIntervals(2);
wid.push_back(myAdjustScanlinesNTSC);
@ -148,8 +147,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
// Aspect ratio (PAL mode)
myAdjustScanlinesPAL =
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
"PAL scanlines adjust ", lwidth, 0,
fontWidth * 4, "", SliderWidget::DEF_LBL_GAP, true);
"PAL scanlines adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
myAdjustScanlinesPAL->setMinValue(-25); myAdjustScanlinesPAL->setMaxValue(25);
myAdjustScanlinesPAL->setTickmarkIntervals(2);
wid.push_back(myAdjustScanlinesPAL);

View File

@ -639,6 +639,8 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
if(_valueLabelWidth == 0)
_valueLabelGap = 0;
if(_valueLabelGap == 0)
_valueLabelGap = DEF_LBL_GAP;
_w = w + _labelWidth + _valueLabelGap + _valueLabelWidth;
}

View File

@ -314,19 +314,16 @@ class CheckboxWidget : public ButtonWidget
class SliderWidget : public ButtonWidget
{
public:
static const int DEF_LBL_GAP = 4;
SliderWidget(GuiObject* boss, const GUI::Font& font,
int x, int y, int w, int h,
const string& label = "", int labelWidth = 0, int cmd = 0,
int valueLabelWidth = 0, const string& valueUnit = "",
int valueLabelGap = DEF_LBL_GAP, bool forceLabelSign = false);
int valueLabelGap = 0, bool forceLabelSign = false);
SliderWidget(GuiObject* boss, const GUI::Font& font,
int x, int y,
const string& label = "", int labelWidth = 0, int cmd = 0,
int valueLabelWidth = 0, const string& valueUnit = "",
int valueLabelGap = DEF_LBL_GAP, bool forceLabelSign = false);
int valueLabelGap = 0, bool forceLabelSign = false);
virtual ~SliderWidget() = default;
void setValue(int value);
@ -345,6 +342,9 @@ class SliderWidget : public ButtonWidget
void setTickmarkIntervals(int numIntervals);
protected:
const int DEF_LBL_GAP = 4;
protected:
void handleMouseMoved(int x, int y) override;
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;