[Preferences Refactor] Remove window size combo box from graphics preferences

Windows can be resized on their own, we do not need this box
This should also fix window resizing when applying preferences.
This commit is contained in:
Inusaito Sayori
2014-06-02 20:22:15 -04:00
parent 001e45627b
commit ac106b0aff
8 changed files with 0 additions and 190 deletions

View File

@@ -166,8 +166,6 @@ BOOL LLPanelDisplay::postBuild()
}
}
initWindowSizeControls();
if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio"))
{
mAspectRatio = gViewerWindow->getDisplayAspectRatio();
@@ -350,48 +348,8 @@ BOOL LLPanelDisplay::postBuild()
return TRUE;
}
void LLPanelDisplay::initWindowSizeControls()
{
// Window size
mWindowSizeLabel = getChild<LLTextBox>("WindowSizeLabel");
mCtrlWindowSize = getChild<LLComboBox>("windowsize combo");
// Look to see if current window size matches existing window sizes, if so then
// just set the selection value...
const U32 height = gViewerWindow->getWindowDisplayHeight();
const U32 width = gViewerWindow->getWindowDisplayWidth();
for (S32 i=0; i < mCtrlWindowSize->getItemCount(); i++)
{
U32 height_test = 0;
U32 width_test = 0;
mCtrlWindowSize->setCurrentByIndex(i);
if (extractWindowSizeFromString(mCtrlWindowSize->getValue().asString(), width_test, height_test))
{
if ((height_test == height) && (width_test == width))
{
return;
}
}
}
// ...otherwise, add a new entry with the current window height/width.
LLUIString resolution_label = getString("resolution_format");
resolution_label.setArg("[RES_X]", llformat("%d", width));
resolution_label.setArg("[RES_Y]", llformat("%d", height));
mCtrlWindowSize->add(resolution_label, ADD_TOP);
mCtrlWindowSize->setCurrentByIndex(0);
}
LLPanelDisplay::~LLPanelDisplay()
{
// clean up user data
for (S32 i = 0; i < mCtrlAspectRatio->getItemCount(); i++)
{
mCtrlAspectRatio->setCurrentByIndex(i);
}
for (S32 i = 0; i < mCtrlWindowSize->getItemCount(); i++)
{
mCtrlWindowSize->setCurrentByIndex(i);
}
}
void LLPanelDisplay::refresh()
@@ -475,8 +433,6 @@ void LLPanelDisplay::refreshEnabledState()
mCtrlAspectRatio->setVisible(isFullScreen);
mAspectRatioLabel1->setVisible(isFullScreen);
mCtrlAutoDetectAspect->setVisible(isFullScreen);
mWindowSizeLabel->setVisible(!isFullScreen);
mCtrlWindowSize->setVisible(!isFullScreen);
// disable graphics settings and exit if it's not set to custom
if(!gSavedSettings.getBOOL("RenderCustomSettings"))
@@ -885,12 +841,6 @@ void LLPanelDisplay::apply()
gSavedSettings.setS32("SHRenderVsyncMode", vsync_value);
applyResolution();
// Only set window size if we're not in fullscreen mode
if (mCtrlWindowed->get())
{
applyWindowSize();
}
// Hardware tab
//Still do a bit of voodoo here. V2 forces restart to change FSAA with FBOs off.
@@ -994,35 +944,6 @@ void LLPanelDisplay::applyResolution()
refresh();
}
// Extract from strings of the form "<width> x <height>", e.g. "640 x 480".
bool LLPanelDisplay::extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height)
{
using namespace boost;
cmatch what;
const regex expression("([0-9]+) x ([0-9]+)");
if (regex_match(instr.c_str(), what, expression))
{
width = atoi(what[1].first);
height = atoi(what[2].first);
return true;
}
width = height = 0;
return false;
}
void LLPanelDisplay::applyWindowSize()
{
if (mCtrlWindowSize->getVisible() && (mCtrlWindowSize->getCurrentIndex() != -1))
{
U32 width = 0;
U32 height = 0;
if (extractWindowSizeFromString(mCtrlWindowSize->getValue().asString().c_str(), width,height))
{
LLViewerWindow::movieSize(width, height);
}
}
}
void LLPanelDisplay::onCommitWindowedMode()
{
refresh();

View File

@@ -73,7 +73,6 @@ public:
void setHiddenGraphicsState(bool isHidden);
void apply(); // Apply the changed values.
void applyResolution();
void applyWindowSize();
void cancel();
protected:
@@ -86,7 +85,6 @@ protected:
LLComboBox *mCtrlAspectRatio; // user provided aspect ratio
LLCheckBoxCtrl *mCtrlWindowed; // windowed mode
LLComboBox *mCtrlWindowSize; // window size for windowed mode
/// performance radio group
LLSliderCtrl *mCtrlSliderQuality;
@@ -125,7 +123,6 @@ protected:
LLTextBox *mAspectRatioLabel1;
LLTextBox *mDisplayResLabel;
LLTextBox *mWindowSizeLabel;
LLTextBox *mShaderText;
LLTextBox *mReflectionText;

View File

@@ -2,22 +2,6 @@
<panel label="Grafik" name="Display panel">
<check_box label="Snowglobe in einem Fenster ausführen" name="windowed mode" tool_tip="If unchecked, viewer will display full-screen when logged in."/>
<button label="Empfohlene Einstellungen" tool_tip="Reset to recommended graphics settings" name="Defaults"/>
<text name="WindowSizeLabel">Fenstergröße:</text>
<combo_box name="windowsize combo">
<combo_item name="800x600">800x600</combo_item>
<combo_item name="720x480">720x480 (NTSC)</combo_item>
<combo_item name="768x576">768x576 (PAL)</combo_item>
<combo_item name="1024x768">1024x768</combo_item>
<combo_item name="1280x720">1280x720 (HD)</combo_item>
<combo_item name="1366x768">1366x768</combo_item>
<combo_item name="1280x800">1280x800</combo_item>
<combo_item name="1440x900">1440x900</combo_item>
<combo_item name="1600x900">1600x900 (HD+)</combo_item>
<combo_item name="1680x1050">1680x1050</combo_item>
<combo_item name="1440x1080">1440x1080 (HDV1080)</combo_item>
<combo_item name="1920x1080">1920x1080 (Full-HD)</combo_item>
<combo_item name="2560x1440">2560x1440</combo_item>
</combo_box>
<text name="DisplayResLabel">Anzeigeauflösung:</text>
<text name="AspectRatioLabel1">Aspektverhältnis:</text>

View File

@@ -2,22 +2,6 @@
<panel border="true" bottom="-449" height="438" label="Graphics" name="Display panel" width="517">
<check_box bottom="-23" height="16" initial_value="false" label="Run viewer in a window" left="10" name="windowed mode" width="120" tool_tip="If unchecked, viewer will display full-screen when logged in."/>
<button bottom_delta="4" height="20" left="-210" label="Reset to Defaults" tool_tip="Reset to recommended graphics settings" name="Defaults" width="200"/>
<text bottom="-62" left="10" height="12" name="WindowSizeLabel">Window Size:</text>
<combo_box bottom="-67" height="18" left="165" name="windowsize combo" width="150">
<combo_item name="800x600" value="800 x 600">800x600</combo_item>
<combo_item name="720x480" value="720 x 480">720x480 (NTSC)</combo_item>
<combo_item name="768x576" value="768 x 576">768x576 (PAL)</combo_item>
<combo_item name="1024x768" value="1024 x 768">1024x768</combo_item>
<combo_item name="1280x720" value="1280 x 720">1280x720 (HD)</combo_item>
<combo_item name="1366x768" value="1366 x 768">1366x768</combo_item>
<combo_item name="1280x800" value="1280 x 800">1280x800</combo_item>
<combo_item name="1440x900" value="1440 x 900">1440x900</combo_item>
<combo_item name="1600x900" value="1600 x 900">1600x900 (HD+)</combo_item>
<combo_item name="1680x1050" value="1680 x 1050">1680x1050</combo_item>
<combo_item name="1440x1080" value="1440 x 1080">1440x1080 (HDV1080)</combo_item>
<combo_item name="1920x1080" value="1920 x 1080">1920x1080 (Full-HD)</combo_item>
<combo_item name="2560x1440" value="2560 x 1440">2560x1440</combo_item>
</combo_box>
<text bottom="-62" height="12" left="10" name="DisplayResLabel">Display Resolution:</text>
<combo_box bottom="-67" height="18" left="165" name="fullscreen combo" width="150"/>
<text bottom="-39" height="12" left="10" name="AspectRatioLabel1">Aspect Ratio:</text>
@@ -54,7 +38,6 @@
<check_box bottom_delta="-17" control_name="WindLightUseAtmosShaders" initial_value="true" label="Atmospheric shaders" left_delta="0" name="WindLightUseAtmosShaders"/>
<check_box bottom_delta="-17" control_name="RenderDeferred" initial_value="true" label="Advanced Lighting Model" tool_tip="Deferred Shading" left_delta="0" name="RenderDeferred"/>
<check_box bottom_delta="-17" control_name="RenderDeferredSSAO" height="16" initial_value="true" label="Ambient Occlusion" left_delta="0" name="UseSSAO"/>
<check_box bottom_delta="-17" control_name="RenderDepthOfField" initial_value="true" label="Depth of Field" left_delta="0" name="RenderDepthOfField"/>
<text bottom_delta="-17" height="12" left="15" name="TerrainScaleText">Terrain Scale:</text>
<combo_box bottom_delta="-22" control_name="RenderTerrainScale" label="Terrain Scale" left_delta="-2" name="TerrainScaleCombo" width="160" height="16">
<combo_item name="Low" value="12">Low</combo_item>

View File

@@ -2,50 +2,6 @@
<panel label="Gráficos" name="Display panel">
<check_box label="Ejecutar el Visor en Ventana" name="windowed mode" tool_tip="Si está desmarcado, el visor se ejecutará a pantalla completa cuando inicies sesión."/>
<button label="Valores Predeterminados" name="Defaults" tool_tip="Reiniciar a los valores gráficos recomendados" width="170"/>
<text name="WindowSizeLabel">
Tamaño de la Ventana:
</text>
<combo_box name="windowsize combo">
<combo_item name="800x600">
800x600
</combo_item>
<combo_item name="720x480">
720x480 (NTSC)
</combo_item>
<combo_item name="768x576">
768x576 (PAL)
</combo_item>
<combo_item name="1024x768">
1024x768
</combo_item>
<combo_item name="1280x720">
1280x720 (HD)
</combo_item>
<combo_item name="1366x768">
1366x768
</combo_item>
<combo_item name="1280x800">
1280x800
</combo_item>
<combo_item name="1440x900">
1440x900
</combo_item>
<combo_item name="1600x900">
1600x900 (HD+)
</combo_item>
<combo_item name="1680x1050">
1680x1050
</combo_item>
<combo_item name="1440x1080">
1440x1080 (HDV1080)
</combo_item>
<combo_item name="1920x1080">
1920x1080 (Full-HD)
</combo_item>
<combo_item name="2560x1440">
2560x1440
</combo_item>
</combo_box>
<text name="DisplayResLabel">
Resolución de Pantalla:
</text>

View File

@@ -5,14 +5,6 @@
<text_editor bottom="-56" height="40" left="25" name="FullScreenInfo" width="460">
D&#xE9;cocher cette option pour passer en mode plein &#xE9;cran.
</text_editor>
<text name="WindowSizeLabel">Taille de la fen&#xEA;tre :</text>
<combo_box name="windowsize combo">
<combo_item name="640x480">640 x 480</combo_item>
<combo_item name="800x600">800 x 600</combo_item>
<combo_item name="720x480">720 x 480 (NTSC)</combo_item>
<combo_item name="768x576">68 x 576 (PAL)</combo_item>
<combo_item name="1024x768">1024 x 768</combo_item>
</combo_box>
<text name="DisplayResLabel" width="165">R&#xE9;solution de l'affichage :</text>
<text name="AspectRatioLabel1" tool_tip="largeur/hauteur">Rapport hauteur/largeur :</text>
<combo_box name="aspect_ratio" tool_tip="largeur/hauteur">

View File

@@ -5,9 +5,6 @@
<text_editor name="FullScreenInfo" width="480">
Se deselezionato, all&apos;avvio il programma partirà a schermo intero.
</text_editor>
<text name="WindowSizeLabel">
Dimensione della finestra:
</text>
<text name="DisplayResLabel">
Risoluzione del monitor:
</text>

View File

@@ -5,26 +5,6 @@
<text_editor bottom="-56" height="40" name="FullScreenInfo" width="480">
Se desmarcado, o visualizador irá exibir em tela inteira quando fizer o acesso.
</text_editor>
<text name="WindowSizeLabel">
Tamanho da Janela:
</text>
<combo_box name="windowsize combo">
<combo_item name="640x480">
640x480
</combo_item>
<combo_item name="800x600">
800x600
</combo_item>
<combo_item name="720x480">
720x480 (NTSC)
</combo_item>
<combo_item name="768x576">
768x576 (PAL)
</combo_item>
<combo_item name="1024x768">
1024x768
</combo_item>
</combo_box>
<text name="DisplayResLabel">
Resolução de Display:
</text>