Change themes *_color_* to *_*_color
Changed: font_color_accel -> font_accelerator_color font_color_bg -> font_unselected_color font_color_disabled -> font_disabled_color font_color_fg -> font_selected_color font_color_hover -> font_hover_color font_color_hover_pressed -> font_hover_pressed_color font_color_pressed -> font_pressed_color font_color_readonly -> font_readonly_color font_color_selected -> font_selected_color font_color_shadow -> font_shadow_color font_color_uneditable -> font_uneditable_color icon_color_disabled -> icon_disabled_color icon_color_hover -> icon_hover_color icon_color_hover_pressed -> icon_hover_pressed_color icon_color_normal -> icon_normal_color icon_color_pressed -> icon_pressed_color Also includes: font_outline_modulate -> font_outline_color tab_fg -> tab_selected tab_bg -> tab_unselected
This commit is contained in:
@@ -38,11 +38,11 @@
|
||||
#include "scene/gui/texture_rect.h"
|
||||
|
||||
Size2 Tabs::get_minimum_size() const {
|
||||
Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
|
||||
Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
|
||||
Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
|
||||
Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
|
||||
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
|
||||
|
||||
int y_margin = MAX(MAX(tab_bg->get_minimum_size().height, tab_fg->get_minimum_size().height), tab_disabled->get_minimum_size().height);
|
||||
int y_margin = MAX(MAX(tab_unselected->get_minimum_size().height, tab_selected->get_minimum_size().height), tab_disabled->get_minimum_size().height);
|
||||
|
||||
Size2 ms(0, 0);
|
||||
|
||||
@@ -61,9 +61,9 @@ Size2 Tabs::get_minimum_size() const {
|
||||
if (tabs[i].disabled) {
|
||||
ms.width += tab_disabled->get_minimum_size().width;
|
||||
} else if (current == i) {
|
||||
ms.width += tab_fg->get_minimum_size().width;
|
||||
ms.width += tab_selected->get_minimum_size().width;
|
||||
} else {
|
||||
ms.width += tab_bg->get_minimum_size().width;
|
||||
ms.width += tab_unselected->get_minimum_size().width;
|
||||
}
|
||||
|
||||
if (tabs[i].right_button.is_valid()) {
|
||||
@@ -71,7 +71,7 @@ Size2 Tabs::get_minimum_size() const {
|
||||
Size2 bms = rb->get_size();
|
||||
bms.width += get_theme_constant("hseparation");
|
||||
ms.width += bms.width;
|
||||
ms.height = MAX(bms.height + tab_bg->get_minimum_size().height, ms.height);
|
||||
ms.height = MAX(bms.height + tab_unselected->get_minimum_size().height, ms.height);
|
||||
}
|
||||
|
||||
if (cb_displaypolicy == CLOSE_BUTTON_SHOW_ALWAYS || (cb_displaypolicy == CLOSE_BUTTON_SHOW_ACTIVE_ONLY && i == current)) {
|
||||
@@ -79,7 +79,7 @@ Size2 Tabs::get_minimum_size() const {
|
||||
Size2 bms = cb->get_size();
|
||||
bms.width += get_theme_constant("hseparation");
|
||||
ms.width += bms.width;
|
||||
ms.height = MAX(bms.height + tab_bg->get_minimum_size().height, ms.height);
|
||||
ms.height = MAX(bms.height + tab_unselected->get_minimum_size().height, ms.height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,12 +268,12 @@ void Tabs::_notification(int p_what) {
|
||||
_update_cache();
|
||||
RID ci = get_canvas_item();
|
||||
|
||||
Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
|
||||
Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
|
||||
Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
|
||||
Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
|
||||
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
|
||||
Color color_fg = get_theme_color("font_color_fg");
|
||||
Color color_bg = get_theme_color("font_color_bg");
|
||||
Color color_disabled = get_theme_color("font_color_disabled");
|
||||
Color font_selected_color = get_theme_color("font_selected_color");
|
||||
Color font_unselected_color = get_theme_color("font_unselected_color");
|
||||
Color font_disabled_color = get_theme_color("font_disabled_color");
|
||||
Ref<Texture2D> close = get_theme_icon("close");
|
||||
Vector2 size = get_size();
|
||||
bool rtl = is_layout_rtl();
|
||||
@@ -316,13 +316,13 @@ void Tabs::_notification(int p_what) {
|
||||
|
||||
if (tabs[i].disabled) {
|
||||
sb = tab_disabled;
|
||||
col = color_disabled;
|
||||
col = font_disabled_color;
|
||||
} else if (i == current) {
|
||||
sb = tab_fg;
|
||||
col = color_fg;
|
||||
sb = tab_selected;
|
||||
col = font_selected_color;
|
||||
} else {
|
||||
sb = tab_bg;
|
||||
col = color_bg;
|
||||
sb = tab_unselected;
|
||||
col = font_unselected_color;
|
||||
}
|
||||
|
||||
if (w + lsize > limit) {
|
||||
@@ -652,8 +652,8 @@ void Tabs::_update_hover() {
|
||||
|
||||
void Tabs::_update_cache() {
|
||||
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
|
||||
Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
|
||||
Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
|
||||
Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
|
||||
Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
|
||||
Ref<Texture2D> incr = get_theme_icon("increment");
|
||||
Ref<Texture2D> decr = get_theme_icon("decrement");
|
||||
int limit = get_size().width - incr->get_width() - decr->get_width();
|
||||
@@ -683,9 +683,9 @@ void Tabs::_update_cache() {
|
||||
if (tabs[i].disabled) {
|
||||
sb = tab_disabled;
|
||||
} else if (i == current) {
|
||||
sb = tab_fg;
|
||||
sb = tab_selected;
|
||||
} else {
|
||||
sb = tab_bg;
|
||||
sb = tab_unselected;
|
||||
}
|
||||
int lsize = tabs[i].size_cache;
|
||||
int slen = tabs[i].size_text;
|
||||
@@ -918,8 +918,8 @@ void Tabs::move_tab(int from, int to) {
|
||||
int Tabs::get_tab_width(int p_idx) const {
|
||||
ERR_FAIL_INDEX_V(p_idx, tabs.size(), 0);
|
||||
|
||||
Ref<StyleBox> tab_bg = get_theme_stylebox("tab_bg");
|
||||
Ref<StyleBox> tab_fg = get_theme_stylebox("tab_fg");
|
||||
Ref<StyleBox> tab_unselected = get_theme_stylebox("tab_unselected");
|
||||
Ref<StyleBox> tab_selected = get_theme_stylebox("tab_selected");
|
||||
Ref<StyleBox> tab_disabled = get_theme_stylebox("tab_disabled");
|
||||
|
||||
int x = 0;
|
||||
@@ -937,9 +937,9 @@ int Tabs::get_tab_width(int p_idx) const {
|
||||
if (tabs[p_idx].disabled) {
|
||||
x += tab_disabled->get_minimum_size().width;
|
||||
} else if (current == p_idx) {
|
||||
x += tab_fg->get_minimum_size().width;
|
||||
x += tab_selected->get_minimum_size().width;
|
||||
} else {
|
||||
x += tab_bg->get_minimum_size().width;
|
||||
x += tab_unselected->get_minimum_size().width;
|
||||
}
|
||||
|
||||
if (tabs[p_idx].right_button.is_valid()) {
|
||||
|
||||
Reference in New Issue
Block a user