From ac106b0aff3cb0c710b6473d7582e2d8f6b6def4 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 2 Jun 2014 20:22:15 -0400 Subject: [PATCH] [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. --- indra/newview/llpaneldisplay.cpp | 79 ------------------- indra/newview/llpaneldisplay.h | 3 - .../xui/de/panel_preferences_graphics1.xml | 16 ---- .../xui/en-us/panel_preferences_graphics1.xml | 17 ---- .../xui/es/panel_preferences_graphics1.xml | 44 ----------- .../xui/fr/panel_preferences_graphics1.xml | 8 -- .../xui/it/panel_preferences_graphics1.xml | 3 - .../xui/pt/panel_preferences_graphics1.xml | 20 ----- 8 files changed, 190 deletions(-) diff --git a/indra/newview/llpaneldisplay.cpp b/indra/newview/llpaneldisplay.cpp index 0c1e60d76..d9c9d6699 100644 --- a/indra/newview/llpaneldisplay.cpp +++ b/indra/newview/llpaneldisplay.cpp @@ -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("WindowSizeLabel"); - mCtrlWindowSize = getChild("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 " x ", 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(); diff --git a/indra/newview/llpaneldisplay.h b/indra/newview/llpaneldisplay.h index 1652b497b..e0ff04ee5 100644 --- a/indra/newview/llpaneldisplay.h +++ b/indra/newview/llpaneldisplay.h @@ -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; diff --git a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml index 54f2fbd43..d7600a3c4 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml @@ -2,22 +2,6 @@