@@ -44,10 +44,12 @@ constexpr float kBorderlessSaturationMax = 2.0f;
4444constexpr float kBorderlessSaturationDefault = 1 .0f ;
4545
4646constexpr float kSettingsContentWidth = 680 .0f ;
47+ constexpr float kSettingsExtendedContentWidth = 820 .0f ;
4748constexpr float kSettingsBaseContentHeight = 480 .0f ;
4849constexpr float kSettingsExtendedContentHeight = 520 .0f ;
4950constexpr float kSettingsWindowFrameHorizontal = 18 .0f ; // 9px left + 9px right
5051constexpr float kSettingsWindowFrameVertical = 22 .0f ; // 20px top + 2px bottom
52+ constexpr float kSettingsBottomButtonAreaHeight = 38 .0f ;
5153constexpr float kPostFxCheckboxOffset = 24 .0f ;
5254
5355float NormalizeSliderValue (float value, float minValue, float maxValue)
@@ -108,14 +110,24 @@ void CSettings::CreateGUI()
108110
109111 CVector2D resolution = CCore::GetSingleton ().GetGUI ()->GetResolution ();
110112
111- CVector2D contentSize (kSettingsContentWidth , kSettingsBaseContentHeight );
113+ const float fBottomButtonAreaHeight = kSettingsBottomButtonAreaHeight ;
114+ CVector2D contentSize (kSettingsContentWidth , kSettingsBaseContentHeight );
115+ const float availableContentWidth = resolution.fX - kSettingsWindowFrameHorizontal ;
116+ if (availableContentWidth >= kSettingsContentWidth )
117+ contentSize.fX = std::min (kSettingsExtendedContentWidth , availableContentWidth);
118+ else if (availableContentWidth > 0 .0f )
119+ contentSize.fX = availableContentWidth;
120+
112121 const float availableContentHeight = resolution.fY - kSettingsWindowFrameVertical ;
113122 if (availableContentHeight >= kSettingsBaseContentHeight )
114123 contentSize.fY = std::min (kSettingsExtendedContentHeight , availableContentHeight);
124+ else if (availableContentHeight > 0 .0f )
125+ contentSize.fY = std::max (availableContentHeight, fBottomButtonAreaHeight + 1 .0f );
126+
127+ contentSize.fX = std::max (contentSize.fX , 0 .0f );
128+ contentSize.fY = std::max (contentSize.fY , fBottomButtonAreaHeight + 1 .0f );
115129
116- float fBottomButtonAreaHeight = 38 ;
117130 CVector2D tabPanelPosition;
118- CVector2D tabPanelSize = contentSize - CVector2D (0 , fBottomButtonAreaHeight );
119131
120132 // Window size is content size plus window frame edge dims
121133 CVector2D windowSize = contentSize + CVector2D (kSettingsWindowFrameHorizontal , kSettingsWindowFrameVertical );
@@ -143,6 +155,8 @@ void CSettings::CreateGUI()
143155 pFiller->SetZOrderingEnabled (false );
144156 pFiller->SetAlwaysOnTop (true );
145157 pFiller->MoveToBack ();
158+ contentSize.fX = std::min (contentSize.fX , resolution.fX );
159+ contentSize.fY = std::min (contentSize.fY , resolution.fY );
146160 pFiller->SetPosition ((resolution - contentSize) / 2 );
147161 pFiller->SetSize (contentSize);
148162 m_pWindow = pFiller;
@@ -152,6 +166,7 @@ void CSettings::CreateGUI()
152166 // Create the tab panel and necessary tabs
153167 m_pTabs = reinterpret_cast <CGUITabPanel*>(pManager->CreateTabPanel (m_pWindow));
154168 m_pTabs->SetPosition (tabPanelPosition);
169+ const CVector2D tabPanelSize = CVector2D (contentSize.fX , std::max (0 .0f , contentSize.fY - fBottomButtonAreaHeight ));
155170 m_pTabs->SetSize (tabPanelSize);
156171 m_pTabs->SetSelectionHandler (GUI_CALLBACK (&CSettings::OnTabChanged, this ));
157172
0 commit comments