Merge pull request #10459 from unknownbrackets/ui-resized

UI: Trigger view recreate on static sized screens
This commit is contained in:
Henrik Rydgård 2017-12-27 11:07:35 +01:00 committed by GitHub
commit 8ebbb82c0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 17 additions and 10 deletions

View File

@ -165,7 +165,11 @@ bool DisplayLayoutScreen::touch(const TouchInput &touch) {
picked_ = 0;
}
return true;
};
}
void DisplayLayoutScreen::resized() {
RecreateViews();
}
void DisplayLayoutScreen::onFinish(DialogResult reason) {
g_Config.Save();

View File

@ -31,6 +31,7 @@ public:
virtual bool touch(const TouchInput &touch) override;
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
virtual void onFinish(DialogResult reason) override;
virtual void resized() override;
std::string tag() const override { return "display layout screen"; }
protected:

View File

@ -1099,10 +1099,6 @@ void NativeResized() {
// NativeResized can come from any thread so we just set a flag, then process it later.
if (g_graphicsInited) {
resized = true;
if (uiContext) {
// Still have to update bounds to avoid problems in display layout and touch controls layout screens
uiContext->SetBounds(Bounds(0, 0, dp_xres, dp_yres));
}
} else {
ILOG("NativeResized ignored, not initialized");
}

View File

@ -279,7 +279,11 @@ bool TouchControlLayoutScreen::touch(const TouchInput &touch) {
pickedControl_ = 0;
}
return true;
};
}
void TouchControlLayoutScreen::resized() {
RecreateViews();
}
void TouchControlLayoutScreen::onFinish(DialogResult reason) {
g_Config.Save();

View File

@ -34,6 +34,7 @@ public:
virtual bool touch(const TouchInput &touch) override;
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
virtual void onFinish(DialogResult reason) override;
virtual void resized() override;
protected:
virtual UI::EventReturn OnReset(UI::EventParams &e);

View File

@ -279,10 +279,6 @@ namespace MainWindow
NativeMessageReceived("gpu_resized", "");
}
if (screenManager) {
screenManager->RecreateAllViews();
}
// Don't save the window state if fullscreen.
if (!g_Config.bFullScreen) {
g_WindowState = newSizingType;

View File

@ -309,6 +309,10 @@ void PopupScreen::TriggerFinish(DialogResult result) {
OnCompleted(result);
}
void PopupScreen::resized() {
RecreateViews();
}
void PopupScreen::CreateViews() {
using namespace UI;
UIContext &dc = *screenManager()->getUIContext();

View File

@ -72,6 +72,7 @@ public:
virtual bool isTransparent() const override { return true; }
virtual bool touch(const TouchInput &touch) override;
virtual bool key(const KeyInput &key) override;
virtual void resized() override;
virtual void TriggerFinish(DialogResult result) override;