aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/impprefsfonts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/impprefsfonts.cpp')
-rw-r--r--linden/indra/newview/impprefsfonts.cpp50
1 files changed, 46 insertions, 4 deletions
diff --git a/linden/indra/newview/impprefsfonts.cpp b/linden/indra/newview/impprefsfonts.cpp
index 3ce71eb..a4dcd34 100644
--- a/linden/indra/newview/impprefsfonts.cpp
+++ b/linden/indra/newview/impprefsfonts.cpp
@@ -29,7 +29,9 @@
29#include "llviewerprecompiledheaders.h" 29#include "llviewerprecompiledheaders.h"
30#include "impprefsfonts.h" 30#include "impprefsfonts.h"
31 31
32#include "llcheckboxctrl.h"
32#include "llradiogroup.h" 33#include "llradiogroup.h"
34#include "llspinctrl.h"
33#include "lluictrlfactory.h" 35#include "lluictrlfactory.h"
34 36
35#include "llviewercontrol.h" 37#include "llviewercontrol.h"
@@ -61,24 +63,64 @@ void ImpPrefsFonts::refresh()
61 { 63 {
62 fonts->setValue( gSavedSettings.getString("FontChoice") ); 64 fonts->setValue( gSavedSettings.getString("FontChoice") );
63 } 65 }
66
67 LLSpinCtrl* font_mult = getChild<LLSpinCtrl>("font_mult");
68 if (font_mult)
69 {
70 font_mult->setValue( gSavedSettings.getF32("FontSizeMultiplier") );
71 }
72
73 LLCheckBoxCtrl* font_round = getChild<LLCheckBoxCtrl>("font_round");
74 if (font_round)
75 {
76 font_round->setValue( gSavedSettings.getBOOL("FontSizeRounding") );
77 }
64} 78}
65 79
66void ImpPrefsFonts::apply() 80void ImpPrefsFonts::apply()
67{ 81{
68 LLRadioGroup* fonts = getChild<LLRadioGroup>("fonts"); 82 bool changed = false;
69 83
84 LLRadioGroup* fonts = getChild<LLRadioGroup>("fonts");
70 if (fonts) 85 if (fonts)
71 { 86 {
72 std::string font_choice = fonts->getValue().asString(); 87 std::string font_choice = fonts->getValue().asString();
73
74 if (font_choice != gSavedSettings.getString("FontChoice") && 88 if (font_choice != gSavedSettings.getString("FontChoice") &&
75 !font_choice.empty()) 89 !font_choice.empty())
76 { 90 {
77 gSavedSettings.setString("FontChoice", font_choice); 91 gSavedSettings.setString("FontChoice", font_choice);
78 LLNotifications::instance().add("ChangeFont"); 92 changed = true;
79 refresh();
80 } 93 }
81 } 94 }
95
96 LLSpinCtrl* font_mult = getChild<LLSpinCtrl>("font_mult");
97 if (font_mult)
98 {
99 F32 mult = font_mult->getValue().asReal();
100 if (mult != gSavedSettings.getF32("FontSizeMultiplier"))
101 {
102 gSavedSettings.setF32("FontSizeMultiplier", mult);
103 changed = true;
104 }
105 }
106
107 LLCheckBoxCtrl* font_round = getChild<LLCheckBoxCtrl>("font_round");
108 if (font_round)
109 {
110 BOOL round = font_round->getValue().asBoolean();
111 if (round != gSavedSettings.getBOOL("FontSizeRounding"))
112 {
113 gSavedSettings.setBOOL("FontSizeRounding", round);
114 changed = true;
115 }
116 }
117
118 if (changed)
119 {
120 refresh();
121 LLNotifications::instance().add("ChangeFont");
122 }
123
82} 124}
83 125
84void ImpPrefsFonts::cancel() 126void ImpPrefsFonts::cancel()