Centered, full-width background image
After a previous UI change, the image container had an offset to the left side with the contained image left-aligned. This change makes the container full-width and centers the image. In addition, the piano keyboard has been adapted accordingly, leaving more room for the panels. The background image size has been increased to 800x300.
This commit is contained in:
parent
9b2b67a669
commit
4781a3708b
4 changed files with 35 additions and 19 deletions
|
|
@ -7,7 +7,7 @@ widget_class mainView {open
|
|||
class LogicalGroup visible
|
||||
} {
|
||||
Fl_Box imageContainer_ {
|
||||
image {../resources/background.png} xywh {90 110 790 285}
|
||||
image {../resources/background.png} xywh {0 110 800 300}
|
||||
class Background
|
||||
}
|
||||
Fl_Group {} {
|
||||
|
|
@ -162,11 +162,11 @@ widget_class mainView {open
|
|||
}
|
||||
}
|
||||
Fl_Group {subPanels_[kPanelInfo]} {
|
||||
xywh {5 110 790 285} hide
|
||||
xywh {5 110 790 300} hide
|
||||
class LogicalGroup
|
||||
} {
|
||||
Fl_Group {} {
|
||||
xywh {5 110 790 285} box ROUNDED_BOX
|
||||
xywh {5 110 790 300} box ROUNDED_BOX
|
||||
class RoundedGroup
|
||||
} {
|
||||
Fl_Box {} {
|
||||
|
|
@ -222,15 +222,15 @@ widget_class mainView {open
|
|||
}
|
||||
}
|
||||
Fl_Group {subPanels_[kPanelControls]} {
|
||||
xywh {5 110 790 285} hide
|
||||
xywh {5 110 790 300} hide
|
||||
class LogicalGroup
|
||||
} {
|
||||
Fl_Group {} {
|
||||
xywh {5 110 790 285} box ROUNDED_BOX
|
||||
xywh {5 110 790 300} box ROUNDED_BOX
|
||||
class RoundedGroup
|
||||
} {
|
||||
Fl_Group controlsPanel_ {
|
||||
xywh {5 110 790 285} box THIN_DOWN_FRAME labelsize 12
|
||||
xywh {5 110 790 300} box THIN_DOWN_FRAME labelsize 12
|
||||
class ControlsPanel
|
||||
} {}
|
||||
}
|
||||
|
|
@ -240,7 +240,7 @@ widget_class mainView {open
|
|||
class LogicalGroup
|
||||
} {
|
||||
Fl_Group {} {open
|
||||
xywh {5 110 790 285} box ROUNDED_BOX
|
||||
xywh {5 110 790 300} box ROUNDED_BOX
|
||||
class RoundedGroup
|
||||
} {
|
||||
Fl_Spinner oversamplingSlider_ {
|
||||
|
|
@ -443,11 +443,11 @@ widget_class mainView {open
|
|||
}
|
||||
}
|
||||
Fl_Box piano_ {
|
||||
xywh {5 400 790 70} labelsize 12
|
||||
xywh {0 410 800 70} labelsize 16
|
||||
class Piano
|
||||
}
|
||||
Fl_Group {subPanels_[kPanelGeneral]} {
|
||||
xywh {5 110 790 285} hide
|
||||
xywh {5 110 790 300} hide
|
||||
class LogicalGroup
|
||||
} {}
|
||||
Fl_Box lblHover_ {
|
||||
|
|
|
|||
|
|
@ -737,6 +737,13 @@ void Editor::Impl::createFrameContents()
|
|||
return box;
|
||||
};
|
||||
#if 0
|
||||
auto createSquaredGroup = [this, &palette](const CRect& bounds, int, const char*, CHoriTxtAlign, int) {
|
||||
auto* box = new SBoxContainer(bounds);
|
||||
OnThemeChanged.push_back([box, palette]() {
|
||||
box->setBackgroundColor(palette->boxBackground);
|
||||
});
|
||||
return box;
|
||||
};
|
||||
auto createTitleGroup = [this, &palette](const CRect& bounds, int, const char* label, CHoriTxtAlign, int fontsize) {
|
||||
auto* box = new STitleContainer(bounds, label);
|
||||
box->setCornerRadius(10.0);
|
||||
|
|
@ -1909,6 +1916,12 @@ void Editor::Impl::applyBackgroundForCurrentPanel()
|
|||
bitmap = defaultBackgroundBitmap_;
|
||||
|
||||
downscaleToWidthAndHeight(bitmap, imageContainer_->getViewSize().getSize());
|
||||
|
||||
// Centered image
|
||||
CCoord xoffset =
|
||||
(imageContainer_->getViewSize().getWidth() - bitmap->getWidth()) / 2;
|
||||
|
||||
imageContainer_->setBackgroundOffset(CPoint(-xoffset, 0));
|
||||
imageContainer_->setBackground(bitmap);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,9 @@ struct SPiano::Impl {
|
|||
CCoord spacingY_ = 4.0;
|
||||
|
||||
CColor backgroundFill_ { 0xca, 0xca, 0xca, 0xff };
|
||||
#if 0
|
||||
float backgroundRadius_ = 5.0;
|
||||
|
||||
#endif
|
||||
float keyUsedHue_ = 0.55;
|
||||
float keySwitchHue_ = 0.0;
|
||||
float whiteKeyChroma_ = 0.9;
|
||||
|
|
@ -170,7 +171,9 @@ void SPiano::draw(CDrawContext* dc)
|
|||
if (impl.backgroundFill_.alpha > 0) {
|
||||
SharedPointer<CGraphicsPath> path;
|
||||
path = owned(dc->createGraphicsPath());
|
||||
#if 0
|
||||
path->addRoundRect(dim.bounds, impl.backgroundRadius_);
|
||||
#endif
|
||||
dc->setFillColor(impl.backgroundFill_);
|
||||
dc->drawGraphicsPath(path, CDrawContext::kPathFilled);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/* This file is generated by the layout maker tool. */
|
||||
auto* const view__0 = createLogicalGroup(CRect(0, 0, 800, 475), -1, "", kCenterText, 14);
|
||||
mainView = view__0;
|
||||
auto* const view__1 = createBackground(CRect(90, 110, 880, 395), -1, "", kCenterText, 14);
|
||||
auto* const view__1 = createBackground(CRect(0, 110, 800, 410), -1, "", kCenterText, 14);
|
||||
imageContainer_ = view__1;
|
||||
view__0->addView(view__1);
|
||||
enterPalette(invertedPalette);
|
||||
|
|
@ -88,11 +88,11 @@ auto* const view__32 = createVMeter(CRect(183, 5, 206, 95), -1, "", kCenterText,
|
|||
meters_[1] = view__32;
|
||||
view__26->addView(view__32);
|
||||
enterPalette(defaultPalette);
|
||||
auto* const view__33 = createLogicalGroup(CRect(5, 110, 795, 395), -1, "", kCenterText, 14);
|
||||
auto* const view__33 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
|
||||
subPanels_[kPanelInfo] = view__33;
|
||||
view__0->addView(view__33);
|
||||
view__33->setVisible(false);
|
||||
auto* const view__34 = createRoundedGroup(CRect(0, 0, 790, 285), -1, "", kCenterText, 14);
|
||||
auto* const view__34 = createRoundedGroup(CRect(0, 0, 790, 300), -1, "", kCenterText, 14);
|
||||
view__33->addView(view__34);
|
||||
auto* const view__35 = createLabel(CRect(15, 10, 75, 35), -1, "Curves:", kLeftText, 14);
|
||||
view__34->addView(view__35);
|
||||
|
|
@ -119,19 +119,19 @@ view__34->addView(view__43);
|
|||
auto* const view__44 = createLabel(CRect(115, 110, 155, 135), -1, "0", kCenterText, 14);
|
||||
infoSamplesLabel_ = view__44;
|
||||
view__34->addView(view__44);
|
||||
auto* const view__45 = createLogicalGroup(CRect(5, 110, 795, 395), -1, "", kCenterText, 14);
|
||||
auto* const view__45 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
|
||||
subPanels_[kPanelControls] = view__45;
|
||||
view__0->addView(view__45);
|
||||
view__45->setVisible(false);
|
||||
auto* const view__46 = createRoundedGroup(CRect(0, 0, 790, 285), -1, "", kCenterText, 14);
|
||||
auto* const view__46 = createRoundedGroup(CRect(0, 0, 790, 300), -1, "", kCenterText, 14);
|
||||
view__45->addView(view__46);
|
||||
auto* const view__47 = createControlsPanel(CRect(0, 0, 790, 285), -1, "", kCenterText, 12);
|
||||
auto* const view__47 = createControlsPanel(CRect(0, 0, 790, 300), -1, "", kCenterText, 12);
|
||||
controlsPanel_ = view__47;
|
||||
view__46->addView(view__47);
|
||||
auto* const view__48 = createLogicalGroup(CRect(0, 110, 825, 470), -1, "", kCenterText, 14);
|
||||
subPanels_[kPanelSettings] = view__48;
|
||||
view__0->addView(view__48);
|
||||
auto* const view__49 = createRoundedGroup(CRect(5, 0, 795, 285), -1, "", kCenterText, 14);
|
||||
auto* const view__49 = createRoundedGroup(CRect(5, 0, 795, 300), -1, "", kCenterText, 14);
|
||||
view__48->addView(view__49);
|
||||
auto* const view__50 = createValueMenu(CRect(170, 85, 240, 110), kTagSetOversampling, "", kCenterText, 12);
|
||||
oversamplingSlider_ = view__50;
|
||||
|
|
@ -228,10 +228,10 @@ view__49->addView(view__87);
|
|||
auto* const view__88 = createValueMenu(CRect(430, 110, 510, 135), kTagSetFreewheelingOscillatorQuality, "", kCenterText, 12);
|
||||
freewheelingOscillatorQualitySlider_ = view__88;
|
||||
view__49->addView(view__88);
|
||||
auto* const view__89 = createPiano(CRect(5, 400, 795, 470), -1, "", kCenterText, 12);
|
||||
auto* const view__89 = createPiano(CRect(0, 410, 800, 480), -1, "", kCenterText, 16);
|
||||
piano_ = view__89;
|
||||
view__0->addView(view__89);
|
||||
auto* const view__90 = createLogicalGroup(CRect(5, 110, 795, 395), -1, "", kCenterText, 14);
|
||||
auto* const view__90 = createLogicalGroup(CRect(5, 110, 795, 410), -1, "", kCenterText, 14);
|
||||
subPanels_[kPanelGeneral] = view__90;
|
||||
view__0->addView(view__90);
|
||||
view__90->setVisible(false);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue