Revert "[Preferences Refactor] Remove window size combo box from graphics preferences"
The issue wasn't the resolution box, and it apparently has its uses.
This reverts commit ac106b0aff.
Conflicts:
indra/newview/skins/default/xui/en-us/panel_preferences_graphics1.xml
This commit is contained in:
@@ -168,6 +168,8 @@ BOOL LLPanelDisplay::postBuild()
|
||||
}
|
||||
}
|
||||
|
||||
initWindowSizeControls();
|
||||
|
||||
if (gSavedSettings.getBOOL("FullScreenAutoDetectAspectRatio"))
|
||||
{
|
||||
mAspectRatio = gViewerWindow->getDisplayAspectRatio();
|
||||
@@ -330,8 +332,48 @@ 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()
|
||||
@@ -412,6 +454,8 @@ void LLPanelDisplay::refreshEnabledState()
|
||||
mCtrlAspectRatio->setVisible(isFullScreen);
|
||||
mAspectRatioLabel1->setVisible(isFullScreen);
|
||||
mCtrlAutoDetectAspect->setVisible(isFullScreen);
|
||||
mWindowSizeLabel->setVisible(!isFullScreen);
|
||||
mCtrlWindowSize->setVisible(!isFullScreen);
|
||||
|
||||
// Hardware tab
|
||||
getChild<LLUICtrl>("GrapicsCardTextureMemory")->setMinValue(LLViewerTextureList::getMinVideoRamSetting());
|
||||
@@ -679,6 +723,12 @@ void LLPanelDisplay::apply()
|
||||
|
||||
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.
|
||||
//Let's not do that, and instead do pre-V2 FSAA change handling for that particular case
|
||||
@@ -766,6 +816,35 @@ 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();
|
||||
|
||||
@@ -72,9 +72,12 @@ public:
|
||||
void disableUnavailableSettings();
|
||||
void apply(); // Apply the changed values.
|
||||
void applyResolution();
|
||||
void applyWindowSize();
|
||||
void cancel();
|
||||
|
||||
protected:
|
||||
void initWindowSizeControls();
|
||||
bool extractWindowSizeFromString(const std::string& instr, U32 &width, U32 &height);
|
||||
|
||||
// aspect ratio sliders and boxes
|
||||
LLComboBox *mCtrlFullScreen; // Fullscreen resolution
|
||||
@@ -82,6 +85,7 @@ protected:
|
||||
LLComboBox *mCtrlAspectRatio; // user provided aspect ratio
|
||||
|
||||
LLCheckBoxCtrl *mCtrlWindowed; // windowed mode
|
||||
LLComboBox *mCtrlWindowSize; // window size for windowed mode
|
||||
|
||||
/// performance radio group
|
||||
LLSliderCtrl *mCtrlSliderQuality;
|
||||
@@ -103,6 +107,7 @@ protected:
|
||||
|
||||
LLTextBox *mAspectRatioLabel1;
|
||||
LLTextBox *mDisplayResLabel;
|
||||
LLTextBox *mWindowSizeLabel;
|
||||
|
||||
LLCheckBoxCtrl *mVBO;
|
||||
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
<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>
|
||||
|
||||
@@ -2,6 +2,22 @@
|
||||
<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>
|
||||
|
||||
@@ -2,6 +2,50 @@
|
||||
<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>
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
<text_editor bottom="-56" height="40" left="25" name="FullScreenInfo" width="460">
|
||||
Décocher cette option pour passer en mode plein écran.
|
||||
</text_editor>
|
||||
<text name="WindowSizeLabel">Taille de la fenê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é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">
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
<text_editor name="FullScreenInfo" width="480">
|
||||
Se deselezionato, all'avvio il programma partirà a schermo intero.
|
||||
</text_editor>
|
||||
<text name="WindowSizeLabel">
|
||||
Dimensione della finestra:
|
||||
</text>
|
||||
<text name="DisplayResLabel">
|
||||
Risoluzione del monitor:
|
||||
</text>
|
||||
|
||||
@@ -5,6 +5,26 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user