aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
authorJacek Antonelli2010-10-22 18:06:59 -0500
committerJacek Antonelli2010-10-22 18:13:28 -0500
commit22df58bd35e75d420c20707d7dffdd322d35e4dc (patch)
tree280d23376791d09eae0aff178221fe5f54a06906 /linden/indra
parentAdded FontSizeMultiplier and FontSizeRounding settings. (diff)
downloadmeta-impy-22df58bd35e75d420c20707d7dffdd322d35e4dc.zip
meta-impy-22df58bd35e75d420c20707d7dffdd322d35e4dc.tar.gz
meta-impy-22df58bd35e75d420c20707d7dffdd322d35e4dc.tar.bz2
meta-impy-22df58bd35e75d420c20707d7dffdd322d35e4dc.tar.xz
Added FontSizeMultiplier and FontSizeRounding controls to Font prefs.
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/impprefsfonts.cpp50
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml10
2 files changed, 56 insertions, 4 deletions
diff --git a/linden/indra/newview/impprefsfonts.cpp b/linden/indra/newview/impprefsfonts.cpp
index 3ce71eb..bf0b028 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()
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml
index 5865bec..c64ce9f 100644
--- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_fonts.xml
@@ -46,4 +46,14 @@
46 Preview: The quick brown fox jumped over the lazy dog. :) 46 Preview: The quick brown fox jumped over the lazy dog. :)
47 </text> 47 </text>
48 48
49
50 <spinner name="font_mult" label="Font size multiplier:" label_width="130"
51 bottom="-280" left="20" height="16" width="180" follows="left|top"
52 decimal_digits="2" increment="0.01" max_val="3.0" min_val="0.1"
53 tool_tip="Multiply all font sizes by this amount." />
54
55 <check_box name="font_round" follows="left|top"
56 bottom="-300" left="20" height="16" width="300"
57 label="Force integer font sizes (may fix blurry fonts)" />
58
49</panel> 59</panel>