mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-30 14:10:24 +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:
1194
hiro/qt/qt.moc
1194
hiro/qt/qt.moc
File diff suppressed because it is too large
Load Diff
@@ -5,10 +5,11 @@ namespace hiro {
|
||||
auto pLabel::construct() -> void {
|
||||
qtWidget = qtLabel = new QLabel;
|
||||
|
||||
setAlignment(state().alignment);
|
||||
setText(state().text);
|
||||
|
||||
pWidget::construct();
|
||||
setAlignment(state().alignment);
|
||||
setBackgroundColor(state().backgroundColor);
|
||||
setForegroundColor(state().foregroundColor);
|
||||
setText(state().text);
|
||||
}
|
||||
|
||||
auto pLabel::destruct() -> void {
|
||||
@@ -26,6 +27,29 @@ auto pLabel::setAlignment(Alignment alignment) -> void {
|
||||
qtLabel->setAlignment((Qt::Alignment)CalculateAlignment(alignment));
|
||||
}
|
||||
|
||||
auto pLabel::setBackgroundColor(Color color) -> void {
|
||||
if(color) {
|
||||
QPalette palette = qtLabel->palette();
|
||||
palette.setColor(QPalette::Base, QColor(color.red(), color.green(), color.blue()));
|
||||
qtLabel->setBackgroundRole(QPalette::Base);
|
||||
qtLabel->setPalette(palette);
|
||||
qtLabel->setAutoFillBackground(true);
|
||||
} else {
|
||||
//todo
|
||||
}
|
||||
}
|
||||
|
||||
auto pLabel::setForegroundColor(Color color) -> void {
|
||||
if(color) {
|
||||
QPalette palette = qtLabel->palette();
|
||||
palette.setColor(QPalette::Text, QColor(color.red(), color.green(), color.blue()));
|
||||
qtLabel->setForegroundRole(QPalette::Text);
|
||||
qtLabel->setPalette(palette);
|
||||
} else {
|
||||
//todo
|
||||
}
|
||||
}
|
||||
|
||||
auto pLabel::setText(const string& text) -> void {
|
||||
qtLabel->setText(QString::fromUtf8(text));
|
||||
}
|
||||
|
@@ -7,6 +7,8 @@ struct pLabel : pWidget {
|
||||
|
||||
auto minimumSize() const -> Size override;
|
||||
auto setAlignment(Alignment alignment) -> void;
|
||||
auto setBackgroundColor(Color color) -> void;
|
||||
auto setForegroundColor(Color color) -> void;
|
||||
auto setText(const string& text) -> void;
|
||||
|
||||
QLabel* qtLabel = nullptr;
|
||||
|
Reference in New Issue
Block a user