mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-19 15:02:31 +02:00
Update to v106r41 release.
byuu says: Changelog: - hiro: added Label::set(Background,Foreground)Color (not implemented on Cocoa backend) - hiro: added (Horizontal,Vertical)Layout::setPadding() - setMargin(m) is now an alias to setPadding({m, m, m, m}) - hiro/Windows: update Label rendering to draw to an offscreen canvas to prevent flickering - sfc: reverted back to 224/240-line height (from 223/239-line height in earlier v106 WIPs) - bsnes: new multi-segment status bar added - bsnes: exiting fullscreen mode will resize and recenter window - this is required; the window geometry gets all scrambled when toggling fullscreen mode - bsnes: updated to a new logo [Ange Albertini] Errata: - hiro/Windows: try to paint Label backgroundColor quicker to avoid startup flicker - `WM_ERASEBKGND` fallthrough to `WM_PAINT` seems to work - hiro/Qt: use Window backgroundColor for Label when no Label backgroundColor set - bsnes: update size multipliers in presentation.cpp to 224/240 (main window size is off in this WIP)
This commit is contained in:
@@ -38,7 +38,10 @@ auto mHorizontalLayout::minimumSize() const -> Size {
|
||||
height = max(height, child.height());
|
||||
}
|
||||
|
||||
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
||||
return {
|
||||
settings.padding.x() + width + settings.padding.width(),
|
||||
settings.padding.y() + height + settings.padding.height()
|
||||
};
|
||||
}
|
||||
|
||||
auto mHorizontalLayout::remove(sSizable sizable) -> type& {
|
||||
@@ -85,10 +88,10 @@ auto mHorizontalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||
}
|
||||
|
||||
Geometry geometry = containerGeometry;
|
||||
geometry.setX (geometry.x() + settings.margin );
|
||||
geometry.setY (geometry.y() + settings.margin );
|
||||
geometry.setWidth (geometry.width() - settings.margin * 2);
|
||||
geometry.setHeight(geometry.height() - settings.margin * 2);
|
||||
geometry.setX (geometry.x() + settings.padding.x());
|
||||
geometry.setY (geometry.y() + settings.padding.y());
|
||||
geometry.setWidth (geometry.width() - settings.padding.x() - settings.padding.width());
|
||||
geometry.setHeight(geometry.height() - settings.padding.y() - settings.padding.height());
|
||||
|
||||
float minimumWidth = 0, maximumWidthCounter = 0;
|
||||
for(auto& child : properties) {
|
||||
@@ -121,12 +124,19 @@ auto mHorizontalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||
}
|
||||
|
||||
auto mHorizontalLayout::setMargin(float margin) -> type& {
|
||||
settings.margin = margin;
|
||||
setPadding({margin, margin, margin, margin});
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto mHorizontalLayout::setPadding(Geometry padding) -> type& {
|
||||
settings.padding = padding;
|
||||
setGeometry(geometry());
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto mHorizontalLayout::setSpacing(float spacing) -> type& {
|
||||
settings.spacing = spacing;
|
||||
setGeometry(geometry());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -15,12 +15,13 @@ struct mHorizontalLayout : mLayout {
|
||||
auto setFont(const Font& font = {}) -> type& override;
|
||||
auto setGeometry(Geometry geometry) -> type& override;
|
||||
auto setMargin(float margin = 0) -> type&;
|
||||
auto setPadding(Geometry padding = {}) -> type&;
|
||||
auto setSpacing(float spacing = 5) -> type&;
|
||||
auto setVisible(bool visible = true) -> type&;
|
||||
|
||||
struct Settings {
|
||||
float alignment = 0.5;
|
||||
float margin = 0;
|
||||
Geometry padding;
|
||||
float spacing = 5;
|
||||
} settings;
|
||||
|
||||
|
@@ -13,11 +13,12 @@ using sHorizontalLayout = shared_pointer<mHorizontalLayout>;
|
||||
struct HorizontalLayout : sHorizontalLayout {
|
||||
DeclareSharedLayout(HorizontalLayout)
|
||||
|
||||
auto append(sSizable sizable, Size size, signed spacing = 5) { return self().append(sizable, size, spacing), *this; }
|
||||
auto modify(sSizable sizable, Size size, signed spacing = 5) { return self().modify(sizable, size, spacing), *this; }
|
||||
auto setAlignment(double alignment = 0.5) { return self().setAlignment(alignment), *this; }
|
||||
auto setMargin(signed margin = 0) { return self().setMargin(margin), *this; }
|
||||
auto setSpacing(signed spacing = 5) { return self().setSpacing(spacing), *this; }
|
||||
auto append(sSizable sizable, Size size, float spacing = 5) { return self().append(sizable, size, spacing), *this; }
|
||||
auto modify(sSizable sizable, Size size, float spacing = 5) { return self().modify(sizable, size, spacing), *this; }
|
||||
auto setAlignment(float alignment = 0.5) { return self().setAlignment(alignment), *this; }
|
||||
auto setMargin(float margin = 0) { return self().setMargin(margin), *this; }
|
||||
auto setPadding(Geometry padding = {}) { return self().setPadding(padding), *this; }
|
||||
auto setSpacing(float spacing = 5) { return self().setSpacing(spacing), *this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -26,11 +27,12 @@ using sVerticalLayout = shared_pointer<mVerticalLayout>;
|
||||
struct VerticalLayout : sVerticalLayout {
|
||||
DeclareSharedLayout(VerticalLayout)
|
||||
|
||||
auto append(sSizable sizable, Size size, signed spacing = 5) { return self().append(sizable, size, spacing), *this; }
|
||||
auto modify(sSizable sizable, Size size, signed spacing = 5) { return self().modify(sizable, size, spacing), *this; }
|
||||
auto setAlignment(double alignment = 0.0) { return self().setAlignment(alignment), *this; }
|
||||
auto setMargin(signed margin = 0) { return self().setMargin(margin), *this; }
|
||||
auto setSpacing(signed spacing = 5) { return self().setSpacing(spacing), *this; }
|
||||
auto append(sSizable sizable, Size size, float spacing = 5) { return self().append(sizable, size, spacing), *this; }
|
||||
auto modify(sSizable sizable, Size size, float spacing = 5) { return self().modify(sizable, size, spacing), *this; }
|
||||
auto setAlignment(float alignment = 0.0) { return self().setAlignment(alignment), *this; }
|
||||
auto setMargin(float margin = 0) { return self().setMargin(margin), *this; }
|
||||
auto setPadding(Geometry padding = {}) { return self().setPadding(padding), *this; }
|
||||
auto setSpacing(float spacing = 5) { return self().setSpacing(spacing), *this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@@ -38,7 +38,10 @@ auto mVerticalLayout::minimumSize() const -> Size {
|
||||
if(&child != &properties.right()) height += child.spacing();
|
||||
}
|
||||
|
||||
return {settings.margin * 2 + width, settings.margin * 2 + height};
|
||||
return {
|
||||
settings.padding.x() + width + settings.padding.width(),
|
||||
settings.padding.y() + height + settings.padding.height()
|
||||
};
|
||||
}
|
||||
|
||||
auto mVerticalLayout::remove(sSizable sizable) -> type& {
|
||||
@@ -85,10 +88,10 @@ auto mVerticalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||
}
|
||||
|
||||
Geometry geometry = containerGeometry;
|
||||
geometry.setX (geometry.x() + settings.margin );
|
||||
geometry.setY (geometry.y() + settings.margin );
|
||||
geometry.setWidth (geometry.width() - settings.margin * 2);
|
||||
geometry.setHeight(geometry.height() - settings.margin * 2);
|
||||
geometry.setX (geometry.x() + settings.padding.x());
|
||||
geometry.setY (geometry.y() + settings.padding.y());
|
||||
geometry.setWidth (geometry.width() - settings.padding.x() - settings.padding.width());
|
||||
geometry.setHeight(geometry.height() - settings.padding.y() - settings.padding.height());
|
||||
|
||||
float minimumHeight = 0, maximumHeightCounter = 0;
|
||||
for(auto& child : properties) {
|
||||
@@ -121,12 +124,19 @@ auto mVerticalLayout::setGeometry(Geometry containerGeometry) -> type& {
|
||||
}
|
||||
|
||||
auto mVerticalLayout::setMargin(float margin) -> type& {
|
||||
settings.margin = margin;
|
||||
setPadding({margin, margin, margin, margin});
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto mVerticalLayout::setPadding(Geometry padding) -> type& {
|
||||
settings.padding = padding;
|
||||
setGeometry(geometry());
|
||||
return *this;
|
||||
}
|
||||
|
||||
auto mVerticalLayout::setSpacing(float spacing) -> type& {
|
||||
settings.spacing = spacing;
|
||||
setGeometry(geometry());
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -15,12 +15,13 @@ struct mVerticalLayout : mLayout {
|
||||
auto setFont(const Font& font = {}) -> type& override;
|
||||
auto setGeometry(Geometry geometry) -> type& override;
|
||||
auto setMargin(float margin = 0) -> type&;
|
||||
auto setPadding(Geometry padding = {}) -> type&;
|
||||
auto setSpacing(float spacing = 5) -> type&;
|
||||
auto setVisible(bool visible = true) -> type& override;
|
||||
|
||||
struct Settings {
|
||||
float alignment = 0.0;
|
||||
float margin = 0;
|
||||
Geometry padding;
|
||||
float spacing = 5;
|
||||
} settings;
|
||||
|
||||
|
Reference in New Issue
Block a user