@@ -46,10 +46,12 @@ constexpr float kBorderlessSaturationMax = 2.0f;
4646constexpr float kBorderlessSaturationDefault = 1 .0f ;
4747
4848constexpr float kSettingsContentWidth = 680 .0f ;
49+ constexpr float kSettingsExtendedContentWidth = 820 .0f ;
4950constexpr float kSettingsBaseContentHeight = 480 .0f ;
5051constexpr float kSettingsExtendedContentHeight = 520 .0f ;
5152constexpr float kSettingsWindowFrameHorizontal = 18 .0f ; // 9px left + 9px right
5253constexpr float kSettingsWindowFrameVertical = 22 .0f ; // 20px top + 2px bottom
54+ constexpr float kSettingsBottomButtonAreaHeight = 38 .0f ;
5355constexpr float kPostFxCheckboxOffset = 24 .0f ;
5456
5557float NormalizeSliderValue (float value, float minValue, float maxValue)
@@ -110,14 +112,24 @@ void CSettings::CreateGUI()
110112
111113 CVector2D resolution = CCore::GetSingleton ().GetGUI ()->GetResolution ();
112114
113- CVector2D contentSize (kSettingsContentWidth , kSettingsBaseContentHeight );
115+ const float fBottomButtonAreaHeight = kSettingsBottomButtonAreaHeight ;
116+ CVector2D contentSize (kSettingsContentWidth , kSettingsBaseContentHeight );
117+ const float availableContentWidth = resolution.fX - kSettingsWindowFrameHorizontal ;
118+ if (availableContentWidth >= kSettingsContentWidth )
119+ contentSize.fX = std::min (kSettingsExtendedContentWidth , availableContentWidth);
120+ else if (availableContentWidth > 0 .0f )
121+ contentSize.fX = availableContentWidth;
122+
114123 const float availableContentHeight = resolution.fY - kSettingsWindowFrameVertical ;
115124 if (availableContentHeight >= kSettingsBaseContentHeight )
116125 contentSize.fY = std::min (kSettingsExtendedContentHeight , availableContentHeight);
126+ else if (availableContentHeight > 0 .0f )
127+ contentSize.fY = std::max (availableContentHeight, fBottomButtonAreaHeight + 1 .0f );
128+
129+ contentSize.fX = std::max (contentSize.fX , 0 .0f );
130+ contentSize.fY = std::max (contentSize.fY , fBottomButtonAreaHeight + 1 .0f );
117131
118- float fBottomButtonAreaHeight = 38 ;
119132 CVector2D tabPanelPosition;
120- CVector2D tabPanelSize = contentSize - CVector2D (0 , fBottomButtonAreaHeight );
121133
122134 // Window size is content size plus window frame edge dims
123135 CVector2D windowSize = contentSize + CVector2D (kSettingsWindowFrameHorizontal , kSettingsWindowFrameVertical );
@@ -145,6 +157,8 @@ void CSettings::CreateGUI()
145157 pFiller->SetZOrderingEnabled (false );
146158 pFiller->SetAlwaysOnTop (true );
147159 pFiller->MoveToBack ();
160+ contentSize.fX = std::min (contentSize.fX , resolution.fX );
161+ contentSize.fY = std::min (contentSize.fY , resolution.fY );
148162 pFiller->SetPosition ((resolution - contentSize) / 2 );
149163 pFiller->SetSize (contentSize);
150164 m_pWindow = pFiller;
@@ -154,6 +168,7 @@ void CSettings::CreateGUI()
154168 // Create the tab panel and necessary tabs
155169 m_pTabs = reinterpret_cast <CGUITabPanel*>(pManager->CreateTabPanel (m_pWindow));
156170 m_pTabs->SetPosition (tabPanelPosition);
171+ const CVector2D tabPanelSize = CVector2D (contentSize.fX , std::max (0 .0f , contentSize.fY - fBottomButtonAreaHeight ));
157172 m_pTabs->SetSize (tabPanelSize);
158173 m_pTabs->SetSelectionHandler (GUI_CALLBACK (&CSettings::OnTabChanged, this ));
159174
0 commit comments