mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-16 17:24:18 +02:00
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:
@@ -1,6 +1,8 @@
|
||||
#if defined(Hiro_BrowserDialog)
|
||||
|
||||
struct BrowserDialogWindow {
|
||||
Application::Namespace tr{"BrowserDialog"};
|
||||
|
||||
BrowserDialogWindow(BrowserDialog::State& state) : state(state) {}
|
||||
auto accept() -> void;
|
||||
auto activate() -> void;
|
||||
@@ -171,10 +173,10 @@ auto BrowserDialogWindow::run() -> BrowserDialog::Response {
|
||||
fileName.setBackgroundColor(acceptButton.enabled() ? Color{} : Color{255, 224, 224});
|
||||
});
|
||||
acceptButton.onActivate([&] { accept(); });
|
||||
if(state.action.beginsWith("open")) acceptButton.setText("Open");
|
||||
if(state.action.beginsWith("save")) acceptButton.setText("Save");
|
||||
if(state.action.beginsWith("select")) acceptButton.setText("Select");
|
||||
cancelButton.setText("Cancel").onActivate([&] { window.setModal(false); });
|
||||
if(state.action.beginsWith("open")) acceptButton.setText(tr("Open"));
|
||||
if(state.action.beginsWith("save")) acceptButton.setText(tr("Save"));
|
||||
if(state.action.beginsWith("select")) acceptButton.setText(tr("Select"));
|
||||
cancelButton.setText(tr("Cancel")).onActivate([&] { window.setModal(false); });
|
||||
|
||||
if(!state.filters) state.filters.append("All|*");
|
||||
for(auto& filter : state.filters) {
|
||||
|
@@ -129,7 +129,7 @@ auto mFixedLayoutCell::setVisible(bool visible) -> type& {
|
||||
}
|
||||
|
||||
auto mFixedLayoutCell::sizable() const -> Sizable {
|
||||
return state.sizable;
|
||||
return state.sizable ? state.sizable : Sizable();
|
||||
}
|
||||
|
||||
auto mFixedLayoutCell::synchronize() -> type& {
|
||||
|
@@ -99,8 +99,6 @@ auto mHorizontalLayout::setFont(const Font& font) -> type& {
|
||||
|
||||
auto mHorizontalLayout::setGeometry(Geometry geometry) -> type& {
|
||||
mSizable::setGeometry(geometry);
|
||||
auto window = parentWindow(true);
|
||||
if(!window || !window->visible()) return *this;
|
||||
|
||||
geometry.setX(geometry.x() + padding().x());
|
||||
geometry.setY(geometry.y() + padding().y());
|
||||
@@ -259,7 +257,7 @@ auto mHorizontalLayoutCell::setVisible(bool visible) -> type& {
|
||||
}
|
||||
|
||||
auto mHorizontalLayoutCell::sizable() const -> Sizable {
|
||||
return state.sizable;
|
||||
return state.sizable ? state.sizable : Sizable();
|
||||
}
|
||||
|
||||
auto mHorizontalLayoutCell::size() const -> Size {
|
||||
|
@@ -44,6 +44,8 @@ auto MessageDialog::warning(const string_vector& buttons) -> string {
|
||||
}
|
||||
|
||||
auto MessageDialog::_run() -> string {
|
||||
Application::Namespace tr{"MessageDialog"};
|
||||
|
||||
Window window;
|
||||
VerticalLayout layout{&window};
|
||||
HorizontalLayout messageLayout{&layout, Size{~0, 0}, 5};
|
||||
@@ -57,14 +59,17 @@ auto MessageDialog::_run() -> string {
|
||||
messageText.setText(state.text);
|
||||
for(auto n : range(state.buttons.size())) {
|
||||
Button button{&controlLayout, Size{80, 0}, 5};
|
||||
button.onActivate([&, n] { state.response = state.buttons[n]; window.setModal(false); });
|
||||
button.setText(state.buttons[n]);
|
||||
button.onActivate([&, n] {
|
||||
state.response = state.buttons[n];
|
||||
window.setModal(false);
|
||||
});
|
||||
button.setText(tr(state.buttons[n]));
|
||||
button.setFocused(); //the last button will have effective focus
|
||||
}
|
||||
|
||||
signed widthMessage = 5 + 16 + 5 + Font().size(state.text).width() + 5;
|
||||
signed widthButtons = 5 + state.buttons.size() * 85;
|
||||
signed width = max(320, widthMessage, widthButtons);
|
||||
int widthMessage = 5 + 16 + 5 + Font().size(state.text).width() + 5;
|
||||
int widthButtons = 5 + state.buttons.size() * 85;
|
||||
int width = max(320, widthMessage, widthButtons);
|
||||
|
||||
window.onClose([&] { window.setModal(false); });
|
||||
window.setTitle(state.title);
|
||||
|
@@ -134,8 +134,6 @@ auto mTableLayout::setFont(const Font& font) -> type& {
|
||||
|
||||
auto mTableLayout::setGeometry(Geometry geometry) -> type& {
|
||||
mSizable::setGeometry(geometry);
|
||||
auto window = parentWindow(true);
|
||||
if(!window || !window->visible()) return *this;
|
||||
|
||||
geometry.setX(geometry.x() + padding().x());
|
||||
geometry.setY(geometry.y() + padding().y());
|
||||
@@ -394,7 +392,7 @@ auto mTableLayoutCell::setVisible(bool visible) -> type& {
|
||||
}
|
||||
|
||||
auto mTableLayoutCell::sizable() const -> Sizable {
|
||||
return state.sizable;
|
||||
return state.sizable ? state.sizable : Sizable();
|
||||
}
|
||||
|
||||
auto mTableLayoutCell::size() const -> Size {
|
||||
|
@@ -109,8 +109,6 @@ auto mVerticalLayout::setFont(const Font& font) -> type& {
|
||||
|
||||
auto mVerticalLayout::setGeometry(Geometry geometry) -> type& {
|
||||
mSizable::setGeometry(geometry);
|
||||
auto window = parentWindow(true);
|
||||
if(!window || !window->visible()) return *this;
|
||||
|
||||
geometry.setX(geometry.x() + padding().x());
|
||||
geometry.setY(geometry.y() + padding().y());
|
||||
@@ -269,7 +267,7 @@ auto mVerticalLayoutCell::setVisible(bool visible) -> type& {
|
||||
}
|
||||
|
||||
auto mVerticalLayoutCell::sizable() const -> Sizable {
|
||||
return state.sizable;
|
||||
return state.sizable ? state.sizable : Sizable();
|
||||
}
|
||||
|
||||
auto mVerticalLayoutCell::size() const -> Size {
|
||||
|
Reference in New Issue
Block a user