Update to v106r48 release.

byuu says:

The problems with the Windows and Qt4 ports have all been resolved,
although there's a fairly gross hack on a few Qt widgets to not destruct
once Application::quit() is called to avoid a double free crash (I'm
unsure where Qt is destructing the widgets internally.) The Cocoa port
compiles again at least, though it's bound to have endless problems. I
improved the Label painting in the GTK ports, which fixes the background
color on labels inside TabFrame widgets.

I've optimized the Makefile system even further.

I added a "redo state" command to bsnes, which is created whenever you
load the undo state. There are also hotkeys for both now, although I
don't think they're really something you want to map hotkeys to.

I moved the nall::Locale object inside hiro::Application, so that it can
be used to translate the BrowserDialog and MessageDialog window strings.

I improved the Super Game Boy emulation of `MLT_REQ`, fixing Pokemon
Yellow's custom border and probably more stuff.

Lots of other small fixes and improvements. Things are finally stable
once again after the harrowing layout redesign catastrophe.

Errata:

  - ICD::joypID should be set to 3 on reset(). joypWrite() may as well
    take uint1 instead of bool.
  - hiro/Qt: remove pWindow::setMaximumSize() comment; found a
    workaround for it
  - nall/GNUmakefile: don't set object.path if it's already set (allow
    overrides before including the file)
This commit is contained in:
Tim Allen
2018-07-16 16:16:26 +10:00
parent 6090c63958
commit 393c2395bb
78 changed files with 701 additions and 658 deletions

View File

@@ -39,14 +39,14 @@ auto pFrame::remove(sSizable sizable) -> void {
auto pFrame::setEnabled(bool enabled) -> void {
pWidget::setEnabled(enabled);
if(auto& sizable = _sizable()) sizable->setEnabled(sizable->self().enabled(true));
if(auto sizable = _sizable()) sizable->setEnabled(sizable->self().enabled(true));
}
auto pFrame::setFont(const Font& font) -> void {
@autoreleasepool {
[cocoaView setTitleFont:pFont::create(font)];
}
if(auto& sizable = _sizable()) sizable->setFont(sizable->self().font(true));
if(auto sizable = _sizable()) sizable->setFont(sizable->self().font(true));
}
auto pFrame::setGeometry(Geometry geometry) -> void {
@@ -56,7 +56,7 @@ auto pFrame::setGeometry(Geometry geometry) -> void {
geometry.x() - 3, geometry.y() - (empty ? size.height() - 2 : 1),
geometry.width() + 6, geometry.height() + (empty ? size.height() + 2 : 5)
});
if(auto& sizable = state().sizable) {
if(auto sizable = _sizable()) {
sizable->setGeometry({
geometry.x() + 1, geometry.y() + (empty ? 1 : size.height() - 2),
geometry.width() - 2, geometry.height() - (empty ? 1 : size.height() - 1)
@@ -72,14 +72,14 @@ auto pFrame::setText(const string& text) -> void {
auto pFrame::setVisible(bool visible) -> void {
pWidget::setVisible(visible);
if(auto& sizable = _sizable()) sizable->setVisible(sizable->self().visible(true));
if(auto sizable = _sizable()) sizable->setVisible(sizable->self().visible(true));
}
auto pFrame::_sizable() -> maybe<pSizable&> {
if(auto sizable = state().sizable) {
if(auto self = sizable->self()) return *self;
}
return nothing;
return {};
}
}

View File

@@ -12,7 +12,7 @@
}
-(void) tabView:(NSTabView*)tabView didSelectTabViewItem:(NSTabViewItem*)tabViewItem {
tabFrame->self()->_synchronizeLayout();
tabFrame->self()->_synchronizeSizable();
tabFrame->doChange();
}
@@ -104,8 +104,8 @@ auto pTabFrame::remove(sTabFrameItem item) -> void {
auto pTabFrame::setEnabled(bool enabled) -> void {
pWidget::setEnabled(enabled);
for(auto& item : state().items) {
if(auto& layout = item->state.layout) {
if(auto self = layout->self()) self->setEnabled(layout->enabled(true));
if(auto& sizable = item->state.sizable) {
if(auto self = sizable->self()) self->setEnabled(sizable->enabled(true));
}
}
}
@@ -113,8 +113,8 @@ auto pTabFrame::setEnabled(bool enabled) -> void {
auto pTabFrame::setFont(const Font& font) -> void {
pWidget::setFont(font);
for(auto& item : state().items) {
if(auto& layout = item->state.layout) {
if(auto self = layout->self()) self->setFont(layout->font(true));
if(auto& sizable = item->state.sizable) {
if(auto self = sizable->self()) self->setFont(sizable->font(true));
}
}
}
@@ -129,11 +129,11 @@ auto pTabFrame::setGeometry(Geometry geometry) -> void {
geometry.width() - 2, geometry.height() - 32
});
for(auto& item : state().items) {
if(auto& layout = item->state.layout) {
layout->setGeometry(geometry);
if(auto& sizable = item->state.sizable) {
sizable->setGeometry(geometry);
}
}
_synchronizeLayout();
_synchronizeSizable();
}
auto pTabFrame::setNavigation(Navigation navigation) -> void {
@@ -142,20 +142,20 @@ auto pTabFrame::setNavigation(Navigation navigation) -> void {
auto pTabFrame::setVisible(bool visible) -> void {
pWidget::setVisible(visible);
for(auto& item : state().items) {
if(auto& layout = item->state.layout) {
if(auto self = layout->self()) self->setVisible(layout->visible(true));
if(auto& sizable = item->state.sizable) {
if(auto self = sizable->self()) self->setVisible(sizable->visible(true));
}
}
}
auto pTabFrame::_synchronizeLayout() -> void {
auto pTabFrame::_synchronizeSizable() -> void {
@autoreleasepool {
NSTabViewItem* tabViewItem = [cocoaView selectedTabViewItem];
int selected = tabViewItem ? [cocoaView indexOfTabViewItem:tabViewItem] : -1;
for(auto& item : state().items) {
item->state.selected = item->offset() == selected;
if(auto& layout = item->state.layout) {
if(auto self = layout->self()) self->setVisible(layout->visible(true) && item->selected());
if(auto& sizable = item->state.sizable) {
if(auto self = sizable->self()) self->setVisible(sizable->visible(true) && item->selected());
}
}
}

View File

@@ -31,7 +31,7 @@ struct pTabFrame : pWidget {
auto setNavigation(Navigation navigation) -> void;
auto setVisible(bool visible) -> void override;
auto _synchronizeLayout() -> void;
auto _synchronizeSizable() -> void;
CocoaTabFrame* cocoaTabFrame = nullptr;
vector<CocoaTabFrameItem*> tabs;

View File

@@ -406,7 +406,7 @@ auto pTableView::_width(uint column) -> uint {
uint width = 1;
if(!header->column(column).visible()) return width;
if(header->visible()) width = max(width, _columnWidth(column));
for(auto row : range(state().items)) {
for(auto row : range(state().items.size())) {
width = max(width, _cellWidth(row, column));
}
return width;