File tree Expand file tree Collapse file tree 8 files changed +22
-18
lines changed
Expand file tree Collapse file tree 8 files changed +22
-18
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,8 @@ class RMLUICORE_API StyleSheetSpecification
133133 PropertySpecification properties;
134134
135135 UniquePtr<DefaultStyleSheetParsers> default_parsers;
136+
137+ static StyleSheetSpecification* instance; // singleton
136138};
137139
138140} // namespace Rml
Original file line number Diff line number Diff line change 3737
3838namespace Rml {
3939
40- static const float DEFAULT_REPEAT_DELAY = 0 .5f ;
41- static const float DEFAULT_REPEAT_PERIOD = 0 .1f ;
40+ static const float SLIDER_ARROW_REPEAT_DELAY = 0 .5f ;
41+ static const float SLIDER_ARROW_REPEAT_PERIOD = 0 .1f ;
4242
4343WidgetSlider::WidgetSlider (ElementFormControl* _parent)
4444{
@@ -156,7 +156,7 @@ void WidgetSlider::Update()
156156 arrow_timers[i] -= delta_time;
157157 while (arrow_timers[i] <= 0 )
158158 {
159- arrow_timers[i] += DEFAULT_REPEAT_PERIOD ;
159+ arrow_timers[i] += SLIDER_ARROW_REPEAT_PERIOD ;
160160 SetBarPosition (i == 0 ? OnLineDecrement () : OnLineIncrement ());
161161 }
162162 }
@@ -390,13 +390,13 @@ void WidgetSlider::ProcessEvent(Event& event)
390390 }
391391 else if (event.GetTargetElement () == arrows[0 ])
392392 {
393- arrow_timers[0 ] = DEFAULT_REPEAT_DELAY ;
393+ arrow_timers[0 ] = SLIDER_ARROW_REPEAT_DELAY ;
394394 last_update_time = Clock::GetElapsedTime ();
395395 SetBarPosition (OnLineDecrement ());
396396 }
397397 else if (event.GetTargetElement () == arrows[1 ])
398398 {
399- arrow_timers[1 ] = DEFAULT_REPEAT_DELAY ;
399+ arrow_timers[1 ] = SLIDER_ARROW_REPEAT_DELAY ;
400400 last_update_time = Clock::GetElapsedTime ();
401401 SetBarPosition (OnLineIncrement ());
402402 }
Original file line number Diff line number Diff line change 3636
3737namespace Rml {
3838
39- static UniquePtr<StyleSheetFactory> instance;
39+ UniquePtr<StyleSheetFactory> StyleSheetFactory:: instance;
4040
4141StyleSheetFactory::StyleSheetFactory () :
4242 selectors{
Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ class StyleSheetFactory {
7878 // Custom complex selectors available for style sheets.
7979 using SelectorMap = UnorderedMap<String, StructuralSelectorType>;
8080 SelectorMap selectors;
81+
82+ static UniquePtr<StyleSheetFactory> instance; // singleton
8183};
8284
8385} // namespace Rml
Original file line number Diff line number Diff line change 3737
3838namespace Rml {
3939
40- static inline bool IsTextElement (const Element* element)
41- {
42- return element->GetTagName () == " #text" ;
43- }
44-
4540StyleSheetNode::StyleSheetNode ()
4641{
4742 CalculateAndSetSpecificity ();
@@ -329,7 +324,7 @@ bool StyleSheetNode::TraverseMatch(const Element* element) const
329324 {
330325 // First check if our sibling is a text element and if so skip it. For the descendant/child combinator above we can omit this step since
331326 // text elements don't have children and thus any ancestor is not a text element.
332- if (IsTextElement ( element) )
327+ if (element-> GetTagName () == " #text " )
333328 continue ;
334329 else if (parent->Match (element) && parent->TraverseMatch (element))
335330 return true ;
Original file line number Diff line number Diff line change 4343
4444namespace Rml {
4545
46- static StyleSheetSpecification* instance = nullptr ;
46+ StyleSheetSpecification* StyleSheetSpecification:: instance = nullptr ;
4747
4848
4949struct DefaultStyleSheetParsers {
Original file line number Diff line number Diff line change 3737
3838namespace Rml {
3939
40- static const float DEFAULT_REPEAT_DELAY = 0 .5f ;
41- static const float DEFAULT_REPEAT_PERIOD = 0 .1f ;
40+ static const float SCROLL_ARROW_REPEAT_DELAY = 0 .5f ;
41+ static const float SCROLL_ARROW_REPEAT_PERIOD = 0 .1f ;
4242
4343WidgetScroll::WidgetScroll (Element* _parent)
4444{
@@ -160,7 +160,7 @@ void WidgetScroll::Update()
160160 arrow_timers[i] -= delta_time;
161161 while (arrow_timers[i] <= 0 )
162162 {
163- arrow_timers[i] += DEFAULT_REPEAT_PERIOD ;
163+ arrow_timers[i] += SCROLL_ARROW_REPEAT_PERIOD ;
164164 SetBarPosition (i == 0 ? OnLineDecrement () : OnLineIncrement ());
165165 }
166166 }
@@ -432,13 +432,13 @@ void WidgetScroll::ProcessEvent(Event& event)
432432 {
433433 if (event.GetTargetElement () == arrows[0 ])
434434 {
435- arrow_timers[0 ] = DEFAULT_REPEAT_DELAY ;
435+ arrow_timers[0 ] = SCROLL_ARROW_REPEAT_DELAY ;
436436 last_update_time = Clock::GetElapsedTime ();
437437 SetBarPosition (OnLineDecrement ());
438438 }
439439 else if (event.GetTargetElement () == arrows[1 ])
440440 {
441- arrow_timers[1 ] = DEFAULT_REPEAT_DELAY ;
441+ arrow_timers[1 ] = SCROLL_ARROW_REPEAT_DELAY ;
442442 last_update_time = Clock::GetElapsedTime ();
443443 SetBarPosition (OnLineIncrement ());
444444 }
Original file line number Diff line number Diff line change 2626 *
2727 */
2828
29+ #ifndef RMLUI_DEBUGGER_COMMONSOURCE_H
30+ #define RMLUI_DEBUGGER_COMMONSOURCE_H
31+
2932static const char * common_rcss = R "RCSS(
3033body
3134{
@@ -195,3 +198,5 @@ handle#size_handle
195198 background - color : #888 ;
196199}
197200)RCSS ";
201+
202+ #endif
You can’t perform that action at this time.
0 commit comments