81 |
|
|
82 |
void PG_Window::LoadThemeStyle(const char* widgettype) { |
void PG_Window::LoadThemeStyle(const char* widgettype) { |
83 |
PG_Theme* t = PG_Application::GetTheme(); |
PG_Theme* t = PG_Application::GetTheme(); |
|
int b; |
|
84 |
|
|
85 |
PG_ThemeWidget::LoadThemeStyle(widgettype, "Window"); |
PG_ThemeWidget::LoadThemeStyle(widgettype, "Window"); |
86 |
|
|
87 |
my_titlebar->LoadThemeStyle(widgettype, "Titlebar"); |
my_titlebar->LoadThemeStyle(widgettype, "Titlebar"); |
88 |
|
|
89 |
b = t->FindProperty(widgettype, "Titlebar", "height"); |
t->GetProperty(widgettype, "Titlebar", "height", my_heightTitlebar); |
|
if(b != -1) |
|
|
my_heightTitlebar = b; |
|
|
|
|
90 |
my_titlebar->SizeWidget(my_width, my_heightTitlebar); |
my_titlebar->SizeWidget(my_width, my_heightTitlebar); |
91 |
my_labelTitle->SizeWidget(my_width, my_heightTitlebar); |
my_labelTitle->SizeWidget(my_width, my_heightTitlebar); |
92 |
|
|
93 |
long c = t->FindProperty(widgettype, "Titlebar", "textcolor"); |
PG_Color c = my_labelTitle->GetFontColor(); |
94 |
if(c != -1) |
t->GetColor(widgettype, "Titlebar", "textcolor", c); |
95 |
SetColorTitlebar(c); |
SetColorTitlebar(c); |
96 |
|
|
97 |
b = t->FindProperty(widgettype, "Titlebar", "showclosebutton"); |
t->GetProperty(widgettype, "Titlebar", "showclosebutton", my_showCloseButton); |
|
if(b != -1) |
|
|
my_showCloseButton = (b == 1); |
|
|
|
|
98 |
my_buttonClose->LoadThemeStyle(widgettype, "CloseButton"); |
my_buttonClose->LoadThemeStyle(widgettype, "CloseButton"); |
99 |
|
|
100 |
b = t->FindProperty(widgettype, "Titlebar", "showminimizebutton"); |
t->GetProperty(widgettype, "Titlebar", "showminimizebutton", my_showMinimizeButton); |
|
if(b != -1) |
|
|
my_showMinimizeButton = (b == 1); |
|
|
|
|
101 |
my_buttonMinimize->LoadThemeStyle(widgettype, "MinimizeButton"); |
my_buttonMinimize->LoadThemeStyle(widgettype, "MinimizeButton"); |
102 |
|
|
103 |
my_buttonClose->MoveWidget(PG_Rect(my_width - my_heightTitlebar, 0, my_heightTitlebar, my_heightTitlebar)); |
my_buttonClose->MoveWidget(PG_Rect(my_width - my_heightTitlebar, 0, my_heightTitlebar, my_heightTitlebar)); |
247 |
return true; |
return true; |
248 |
} |
} |
249 |
|
|
250 |
void PG_Window::SetColorTitlebar(const SDL_Color& c) { |
void PG_Window::SetColorTitlebar(const PG_Color& c) { |
|
my_labelTitle->SetFontColor(c); |
|
|
} |
|
|
|
|
|
void PG_Window::SetColorTitlebar(Uint32 color) { |
|
|
SDL_Color c; |
|
|
c.r = (color >> 16) & 0xFF; |
|
|
c.g = (color >> 8) & 0xFF; |
|
|
c.b = color & 0xFF; |
|
|
|
|
251 |
my_labelTitle->SetFontColor(c); |
my_labelTitle->SetFontColor(c); |
252 |
} |
} |
253 |
|
|