mirror of https://github.com/stella-emu/stella.git
aligned SliderWidget parameter default to other defaults
This commit is contained in:
parent
a97cf0ba89
commit
4f9d554a5f
|
@ -137,8 +137,7 @@ GameInfoDialog::GameInfoDialog(
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
t = new StaticTextWidget(myTab, font, HBORDER, ypos + 1, "V-Center ");
|
t = new StaticTextWidget(myTab, font, HBORDER, ypos + 1, "V-Center ");
|
||||||
myVCenter = new SliderWidget(myTab, font, t->getRight() + 2, ypos, "",
|
myVCenter = new SliderWidget(myTab, font, t->getRight() + 2, ypos, "",
|
||||||
0, kVCenterChanged, 7 * fontWidth, "px",
|
0, kVCenterChanged, 7 * fontWidth, "px", 0, true);
|
||||||
SliderWidget::DEF_LBL_GAP, true);
|
|
||||||
|
|
||||||
myVCenter->setMinValue(TIAConstants::minVcenter);
|
myVCenter->setMinValue(TIAConstants::minVcenter);
|
||||||
myVCenter->setMaxValue(TIAConstants::maxVcenter);
|
myVCenter->setMaxValue(TIAConstants::maxVcenter);
|
||||||
|
|
|
@ -138,8 +138,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
// Aspect ratio (NTSC mode)
|
// Aspect ratio (NTSC mode)
|
||||||
myAdjustScanlinesNTSC =
|
myAdjustScanlinesNTSC =
|
||||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||||
"NTSC scanlines adjust ", lwidth, 0,
|
"NTSC scanlines adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
|
||||||
fontWidth * 4, "", SliderWidget::DEF_LBL_GAP, true);
|
|
||||||
myAdjustScanlinesNTSC->setMinValue(-25); myAdjustScanlinesNTSC->setMaxValue(25);
|
myAdjustScanlinesNTSC->setMinValue(-25); myAdjustScanlinesNTSC->setMaxValue(25);
|
||||||
myAdjustScanlinesNTSC->setTickmarkIntervals(2);
|
myAdjustScanlinesNTSC->setTickmarkIntervals(2);
|
||||||
wid.push_back(myAdjustScanlinesNTSC);
|
wid.push_back(myAdjustScanlinesNTSC);
|
||||||
|
@ -148,8 +147,7 @@ VideoDialog::VideoDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
// Aspect ratio (PAL mode)
|
// Aspect ratio (PAL mode)
|
||||||
myAdjustScanlinesPAL =
|
myAdjustScanlinesPAL =
|
||||||
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
new SliderWidget(myTab, font, xpos, ypos-1, swidth, lineHeight,
|
||||||
"PAL scanlines adjust ", lwidth, 0,
|
"PAL scanlines adjust ", lwidth, 0, fontWidth * 4, "", 0, true);
|
||||||
fontWidth * 4, "", SliderWidget::DEF_LBL_GAP, true);
|
|
||||||
myAdjustScanlinesPAL->setMinValue(-25); myAdjustScanlinesPAL->setMaxValue(25);
|
myAdjustScanlinesPAL->setMinValue(-25); myAdjustScanlinesPAL->setMaxValue(25);
|
||||||
myAdjustScanlinesPAL->setTickmarkIntervals(2);
|
myAdjustScanlinesPAL->setTickmarkIntervals(2);
|
||||||
wid.push_back(myAdjustScanlinesPAL);
|
wid.push_back(myAdjustScanlinesPAL);
|
||||||
|
|
|
@ -639,6 +639,8 @@ SliderWidget::SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
|
||||||
if(_valueLabelWidth == 0)
|
if(_valueLabelWidth == 0)
|
||||||
_valueLabelGap = 0;
|
_valueLabelGap = 0;
|
||||||
|
if(_valueLabelGap == 0)
|
||||||
|
_valueLabelGap = DEF_LBL_GAP;
|
||||||
|
|
||||||
_w = w + _labelWidth + _valueLabelGap + _valueLabelWidth;
|
_w = w + _labelWidth + _valueLabelGap + _valueLabelWidth;
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,19 +314,16 @@ class CheckboxWidget : public ButtonWidget
|
||||||
class SliderWidget : public ButtonWidget
|
class SliderWidget : public ButtonWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const int DEF_LBL_GAP = 4;
|
|
||||||
|
|
||||||
|
|
||||||
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h,
|
int x, int y, int w, int h,
|
||||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
const string& label = "", int labelWidth = 0, int cmd = 0,
|
||||||
int valueLabelWidth = 0, const string& valueUnit = "",
|
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,
|
SliderWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y,
|
int x, int y,
|
||||||
const string& label = "", int labelWidth = 0, int cmd = 0,
|
const string& label = "", int labelWidth = 0, int cmd = 0,
|
||||||
int valueLabelWidth = 0, const string& valueUnit = "",
|
int valueLabelWidth = 0, const string& valueUnit = "",
|
||||||
int valueLabelGap = DEF_LBL_GAP, bool forceLabelSign = false);
|
int valueLabelGap = 0, bool forceLabelSign = false);
|
||||||
virtual ~SliderWidget() = default;
|
virtual ~SliderWidget() = default;
|
||||||
|
|
||||||
void setValue(int value);
|
void setValue(int value);
|
||||||
|
@ -345,6 +342,9 @@ class SliderWidget : public ButtonWidget
|
||||||
|
|
||||||
void setTickmarkIntervals(int numIntervals);
|
void setTickmarkIntervals(int numIntervals);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
const int DEF_LBL_GAP = 4;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void handleMouseMoved(int x, int y) override;
|
void handleMouseMoved(int x, int y) override;
|
||||||
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;
|
void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;
|
||||||
|
|
Loading…
Reference in New Issue