mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-14 06:48:40 -04:00
Limit the size of controller-focused inventory windows on large screens
This commit is contained in:
parent
f1c34ea7b1
commit
3eec24b2a6
@ -1010,9 +1010,15 @@ namespace MWGui
|
|||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Inventory)
|
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Inventory)
|
||||||
{
|
{
|
||||||
|
// Fill the screen, or limit to a certain size on large screens.
|
||||||
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
int width = std::min(viewSize.width, 2200);
|
||||||
|
int height = std::min(viewSize.height - 48 - 48, 1200);
|
||||||
|
int x = (viewSize.width - width) / 2;
|
||||||
|
int y = (viewSize.height - height) / 2;
|
||||||
|
|
||||||
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
||||||
window->setCoord(0, active ? 48 : viewSize.height + 49, viewSize.width, viewSize.height - 48 - 48);
|
window->setCoord(x, active ? y : viewSize.height + 1, width, height);
|
||||||
|
|
||||||
adjustPanes();
|
adjustPanes();
|
||||||
updatePreviewSize();
|
updatePreviewSize();
|
||||||
|
@ -1415,9 +1415,16 @@ namespace MWGui
|
|||||||
|
|
||||||
void MapWindow::setActiveControllerWindow(bool active)
|
void MapWindow::setActiveControllerWindow(bool active)
|
||||||
{
|
{
|
||||||
|
// Fill the screen, or limit to a certain size on large screens. Size chosen to
|
||||||
|
// show the entire local map without scrolling.
|
||||||
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
int width = std::min(viewSize.width, 1552);
|
||||||
|
int height = std::min(viewSize.height - 48 - 48, 1572);
|
||||||
|
int x = (viewSize.width - width) / 2;
|
||||||
|
int y = (viewSize.height - height) / 2;
|
||||||
|
|
||||||
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
||||||
window->setCoord(0, active ? 48 : viewSize.height + 49, viewSize.width, viewSize.height - 48 - 48);
|
window->setCoord(x, active ? y : viewSize.height + 1, width, height);
|
||||||
|
|
||||||
WindowBase::setActiveControllerWindow(active);
|
WindowBase::setActiveControllerWindow(active);
|
||||||
}
|
}
|
||||||
|
@ -281,9 +281,16 @@ namespace MWGui
|
|||||||
|
|
||||||
void SpellWindow::setActiveControllerWindow(bool active)
|
void SpellWindow::setActiveControllerWindow(bool active)
|
||||||
{
|
{
|
||||||
|
// Fill the screen, or limit to a certain size on large screens. Size chosen to
|
||||||
|
// match the size of the stats window.
|
||||||
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
int width = std::min(viewSize.width, 600);
|
||||||
|
int height = std::min(viewSize.height - 48 - 48, 750);
|
||||||
|
int x = (viewSize.width - width) / 2;
|
||||||
|
int y = (viewSize.height - height) / 2;
|
||||||
|
|
||||||
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
||||||
window->setCoord(0, active ? 48 : viewSize.height + 49, viewSize.width, viewSize.height - 48 - 48);
|
window->setCoord(x, active ? y : viewSize.height + 1, width, height);
|
||||||
|
|
||||||
WindowBase::setActiveControllerWindow(active);
|
WindowBase::setActiveControllerWindow(active);
|
||||||
}
|
}
|
||||||
|
@ -740,9 +740,16 @@ namespace MWGui
|
|||||||
|
|
||||||
void StatsWindow::setActiveControllerWindow(bool active)
|
void StatsWindow::setActiveControllerWindow(bool active)
|
||||||
{
|
{
|
||||||
|
// Fill the screen, or limit to a certain size on large screens. Size chosen to
|
||||||
|
// show all stats.
|
||||||
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
|
||||||
|
int width = std::min(viewSize.width, 600);
|
||||||
|
int height = std::min(viewSize.height - 48 - 48, 750);
|
||||||
|
int x = (viewSize.width - width) / 2;
|
||||||
|
int y = (viewSize.height - height) / 2;
|
||||||
|
|
||||||
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
MyGUI::Window* window = mMainWidget->castType<MyGUI::Window>();
|
||||||
window->setCoord(0, active ? 48 : viewSize.height + 49, viewSize.width, viewSize.height - 48 - 48);
|
window->setCoord(x, active ? y : viewSize.height + 1, width, height);
|
||||||
|
|
||||||
onWindowResize(window);
|
onWindowResize(window);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user