Update to v106r56 release.

byuu says:

I fixed all outstanding bugs that I'm aware of, including all of the
errata I listed yesterday.

And now it's time for lots of regression testing.

After that, I need to add Talarubi's XAudio2 DRC code, and then get a
new public bsnes WIP out for final testing.

New errata: when setting an icon (nall::image) larger than a Canvas on
Windows, it's not centering the image, so you end up seeing the overscan
area in the state manager previews, and the bottom of the image gets cut
off. I also need to forcefully disable the Xlib screensaver disable
support. I think I'll remove the GUI option to bypass it as well, and
just force screensaver disable always on with Windows. I'll improve it
in the future to toggle the effect between emulator pauses.
This commit is contained in:
Tim Allen
2018-08-06 17:46:00 +10:00
parent b2b51d544f
commit 3b4e8b6d75
29 changed files with 318 additions and 267 deletions

View File

@@ -3,13 +3,10 @@
namespace hiro {
auto pLabel::construct() -> void {
qtWidget = qtLabel = new QLabel;
qtWidget = qtLabel = new QtLabel(*this);
pWidget::construct();
setAlignment(state().alignment);
setBackgroundColor(state().backgroundColor);
setForegroundColor(state().foregroundColor);
setText(state().text);
qtLabel->update();
}
auto pLabel::destruct() -> void {
@@ -23,29 +20,40 @@ auto pLabel::minimumSize() const -> Size {
}
auto pLabel::setAlignment(Alignment alignment) -> void {
if(!alignment) alignment = {0.0, 0.5};
qtLabel->setAlignment((Qt::Alignment)CalculateAlignment(alignment));
qtLabel->update();
}
auto pLabel::setBackgroundColor(Color color) -> void {
static auto defaultColor = qtLabel->palette().color(QPalette::Base);
qtLabel->update();
}
auto palette = qtLabel->palette();
palette.setColor(QPalette::Base, CreateColor(color, defaultColor));
qtLabel->setPalette(palette);
qtLabel->setAutoFillBackground((bool)color);
auto pLabel::setFont(const Font& font) -> void {
pWidget::setFont(font);
qtLabel->update();
}
auto pLabel::setForegroundColor(Color color) -> void {
static auto defaultColor = qtLabel->palette().color(QPalette::Text);
auto palette = qtLabel->palette();
palette.setColor(QPalette::Text, CreateColor(color, defaultColor));
qtLabel->setPalette(palette);
qtLabel->update();
}
auto pLabel::setText(const string& text) -> void {
qtLabel->setText(QString::fromUtf8(text));
qtLabel->update();
}
//QLabel ignores QPalette ... so we have to implement our own Label class atop QWidget ...
auto QtLabel::paintEvent(QPaintEvent* event) -> void {
QPainter painter(p.qtLabel);
if(auto& color = p.state().backgroundColor) {
painter.fillRect(event->rect(), CreateColor(color));
}
if(auto& text = p.state().text) {
if(auto& color = p.state().foregroundColor) {
QPen pen(CreateColor(color));
painter.setPen(pen);
}
auto alignment = p.state().alignment ? p.state().alignment : Alignment{0.0, 0.5};
painter.drawText(event->rect(), CalculateAlignment(alignment), QString::fromUtf8(text));
}
}
}