mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-21 16:20:53 +00:00
Rename newStyles -> styles
This commit is contained in:
parent
ffe2b07d0e
commit
bc4f8ad3e1
@ -276,13 +276,13 @@ private:
|
||||
m_changeConn = obs::connection();
|
||||
m_changeButton.reset(new Button(""));
|
||||
m_changeConn = m_changeButton->Click.connect(base::Bind<void>(&KeyItem::onChangeAccel, this, i));
|
||||
m_changeButton->setStyle(SkinTheme::instance()->newStyles.miniButton());
|
||||
m_changeButton->setStyle(SkinTheme::instance()->styles.miniButton());
|
||||
addChild(m_changeButton.get());
|
||||
|
||||
m_deleteConn = obs::connection();
|
||||
m_deleteButton.reset(new Button(""));
|
||||
m_deleteConn = m_deleteButton->Click.connect(base::Bind<void>(&KeyItem::onDeleteAccel, this, i));
|
||||
m_deleteButton->setStyle(SkinTheme::instance()->newStyles.miniButton());
|
||||
m_deleteButton->setStyle(SkinTheme::instance()->styles.miniButton());
|
||||
addChild(m_deleteButton.get());
|
||||
|
||||
m_changeButton->setBgColor(gfx::ColorNone);
|
||||
@ -309,7 +309,7 @@ private:
|
||||
m_addConn = obs::connection();
|
||||
m_addButton.reset(new Button(""));
|
||||
m_addConn = m_addButton->Click.connect(base::Bind<void>(&KeyItem::onAddAccel, this));
|
||||
m_addButton->setStyle(SkinTheme::instance()->newStyles.miniButton());
|
||||
m_addButton->setStyle(SkinTheme::instance()->styles.miniButton());
|
||||
addChild(m_addButton.get());
|
||||
|
||||
itemBounds.w = 8*guiscale() + Graphics::measureUITextLength("Add", font());
|
||||
@ -510,7 +510,7 @@ private:
|
||||
if (!group) {
|
||||
group = new Separator(
|
||||
section()->children()[sectionIdx]->text(), HORIZONTAL);
|
||||
group->setStyle(SkinTheme::instance()->newStyles.separatorInView());
|
||||
group->setStyle(SkinTheme::instance()->styles.separatorInView());
|
||||
|
||||
searchList()->addChild(group);
|
||||
}
|
||||
|
@ -428,7 +428,7 @@ private:
|
||||
|
||||
void addSeparator() {
|
||||
auto sep = new Separator("", HORIZONTAL);
|
||||
sep->setStyle(SkinTheme::instance()->newStyles.separatorInView());
|
||||
sep->setStyle(SkinTheme::instance()->styles.separatorInView());
|
||||
sep->setBorder(gfx::Border(0, font()->height(), 0, font()->height()));
|
||||
sep->setExpansive(true);
|
||||
addChild(sep);
|
||||
@ -448,7 +448,7 @@ private:
|
||||
if (word.size() > 4 &&
|
||||
std::strncmp(word.c_str(), "http", 4) == 0) {
|
||||
label = new LinkLabel(word);
|
||||
label->setStyle(SkinTheme::instance()->newStyles.browserLink());
|
||||
label->setStyle(SkinTheme::instance()->styles.browserLink());
|
||||
}
|
||||
else
|
||||
label = new Label(word);
|
||||
@ -475,7 +475,7 @@ private:
|
||||
|
||||
void addLink(const std::string& url, const std::string& text) {
|
||||
auto label = new LinkLabel(url, text);
|
||||
label->setStyle(SkinTheme::instance()->newStyles.browserLink());
|
||||
label->setStyle(SkinTheme::instance()->styles.browserLink());
|
||||
|
||||
if (url.find(':') == std::string::npos) {
|
||||
label->setUrl("");
|
||||
@ -516,7 +516,7 @@ BrowserView::BrowserView()
|
||||
|
||||
m_view.attachToView(m_textBox);
|
||||
m_view.setExpansive(true);
|
||||
m_view.setStyle(theme->newStyles.workspaceView());
|
||||
m_view.setStyle(theme->styles.workspaceView());
|
||||
|
||||
m_textBox->FileChange.connect(
|
||||
[]{
|
||||
|
@ -84,7 +84,7 @@ using namespace ui;
|
||||
class ColorBar::WarningIcon : public ui::Button {
|
||||
public:
|
||||
WarningIcon() : ui::Button(std::string()) {
|
||||
setStyle(skin::SkinTheme::instance()->newStyles.warningBox());
|
||||
setStyle(skin::SkinTheme::instance()->styles.warningBox());
|
||||
}
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
ColorBar::ScrollableView::ScrollableView()
|
||||
{
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
setStyle(theme->newStyles.colorbarView());
|
||||
setStyle(theme->styles.colorbarView());
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@ -151,7 +151,7 @@ ColorBar::ColorBar(int align)
|
||||
m_splitter.setId("palette_spectrum_splitter");
|
||||
m_splitter.setPosition(80);
|
||||
m_splitter.setExpansive(true);
|
||||
m_splitter.setStyle(theme->newStyles.workspaceSplitter());
|
||||
m_splitter.setStyle(theme->styles.workspaceSplitter());
|
||||
m_splitter.addChild(&m_palettePlaceholder);
|
||||
m_splitter.addChild(&m_selectorPlaceholder);
|
||||
|
||||
|
@ -53,7 +53,7 @@ ColorButton::ColorButton(const app::Color& color,
|
||||
{
|
||||
setFocusStop(true);
|
||||
initTheme();
|
||||
|
||||
|
||||
UIContext::instance()->add_observer(this);
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ app::Color ColorButton::getColorByPosition(const gfx::Point& pos)
|
||||
void ColorButton::onInitTheme(InitThemeEvent& ev)
|
||||
{
|
||||
ButtonBase::onInitTheme(ev);
|
||||
setStyle(SkinTheme::instance()->newStyles.colorButton());
|
||||
setStyle(SkinTheme::instance()->styles.colorButton());
|
||||
}
|
||||
|
||||
bool ColorButton::onProcessMessage(Message* msg)
|
||||
|
@ -60,7 +60,7 @@ ColorWheel::ColorWheel()
|
||||
setBorder(gfx::Border(3*ui::guiscale()));
|
||||
|
||||
m_options.Click.connect(base::Bind<void>(&ColorWheel::onOptions, this));
|
||||
m_options.setStyle(theme->newStyles.colorWheelOptions());
|
||||
m_options.setStyle(theme->styles.colorWheelOptions());
|
||||
|
||||
addChild(&m_options);
|
||||
}
|
||||
|
@ -662,7 +662,7 @@ class ContextBar::InkShadesField : public HBox {
|
||||
bounds.w = w;
|
||||
}
|
||||
|
||||
theme->paintWidget(g, this, theme->newStyles.view(), bounds);
|
||||
theme->paintWidget(g, this, theme->styles.view(), bounds);
|
||||
|
||||
bounds.shrink(3*guiscale());
|
||||
|
||||
@ -706,7 +706,7 @@ class ContextBar::InkShadesField : public HBox {
|
||||
|
||||
PaintWidgetPartInfo info;
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.shadeSelection(), hotBounds, info);
|
||||
g, theme->styles.shadeSelection(), hotBounds, info);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -79,7 +79,7 @@ DataRecoveryView::DataRecoveryView(crash::DataRecovery* dataRecovery)
|
||||
m_listBox.setMultiselect(true);
|
||||
m_view.setExpansive(true);
|
||||
m_view.attachToView(&m_listBox);
|
||||
m_view.setStyle(theme->newStyles.workspaceView());
|
||||
m_view.setStyle(theme->styles.workspaceView());
|
||||
|
||||
HBox* hbox = new HBox;
|
||||
hbox->setBorder(gfx::Border(2, 0, 2, 0)*guiscale());
|
||||
@ -115,7 +115,7 @@ void DataRecoveryView::fillList()
|
||||
continue;
|
||||
|
||||
auto sep = new Separator(session->name(), HORIZONTAL);
|
||||
sep->setStyle(SkinTheme::instance()->newStyles.separatorInView());
|
||||
sep->setStyle(SkinTheme::instance()->styles.separatorInView());
|
||||
sep->setBorder(sep->border() + gfx::Border(0, 8, 0, 8)*guiscale());
|
||||
m_listBox.addChild(sep);
|
||||
|
||||
|
@ -76,7 +76,7 @@ DevConsoleView::DevConsoleView()
|
||||
m_bottomBox.addChild(&m_label);
|
||||
m_bottomBox.addChild(m_entry);
|
||||
|
||||
m_view.setStyle(theme->newStyles.workspaceView());
|
||||
m_view.setStyle(theme->styles.workspaceView());
|
||||
m_view.attachToView(&m_textBox);
|
||||
m_view.setExpansive(true);
|
||||
|
||||
|
@ -28,8 +28,8 @@ DropDownButton::DropDownButton(const char* text)
|
||||
{
|
||||
SkinTheme* theme = SkinTheme::instance();
|
||||
|
||||
m_button->setStyle(theme->newStyles.dropDownButton());
|
||||
m_dropDown->setStyle(theme->newStyles.dropDownExpandButton());
|
||||
m_button->setStyle(theme->styles.dropDownButton());
|
||||
m_dropDown->setStyle(theme->styles.dropDownExpandButton());
|
||||
|
||||
m_button->setExpansive(true);
|
||||
m_button->Click.connect(&DropDownButton::onButtonClick, this);
|
||||
|
@ -43,7 +43,7 @@ EditorView::EditorView(EditorView::Type type)
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
|
||||
setBgColor(gfx::rgba(0, 0, 0)); // TODO Move this color to theme.xml
|
||||
setStyle(theme->newStyles.editorView());
|
||||
setStyle(theme->styles.editorView());
|
||||
setupScrollbars();
|
||||
|
||||
m_scrollSettingsConn =
|
||||
@ -155,10 +155,10 @@ void EditorView::setupScrollbars()
|
||||
horizontalBar()->setBarWidth(barsize);
|
||||
verticalBar()->setBarWidth(barsize);
|
||||
|
||||
horizontalBar()->setStyle(theme->newStyles.miniScrollbar());
|
||||
verticalBar()->setStyle(theme->newStyles.miniScrollbar());
|
||||
horizontalBar()->setThumbStyle(theme->newStyles.miniScrollbarThumb());
|
||||
verticalBar()->setThumbStyle(theme->newStyles.miniScrollbarThumb());
|
||||
horizontalBar()->setStyle(theme->styles.miniScrollbar());
|
||||
verticalBar()->setStyle(theme->styles.miniScrollbar());
|
||||
horizontalBar()->setThumbStyle(theme->styles.miniScrollbarThumb());
|
||||
verticalBar()->setThumbStyle(theme->styles.miniScrollbarThumb());
|
||||
|
||||
showScrollBars();
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ void HomeView::onNewUpdate(const std::string& url, const std::string& version)
|
||||
|
||||
checkUpdate()->setText("New " PACKAGE " v" + version + " available!");
|
||||
checkUpdate()->setUrl(url);
|
||||
checkUpdate()->setStyle(theme->newStyles.workspaceUpdateLink());
|
||||
checkUpdate()->setStyle(theme->styles.workspaceUpdateLink());
|
||||
checkUpdate()->setVisible(true);
|
||||
|
||||
layout();
|
||||
|
@ -128,7 +128,7 @@ public:
|
||||
protected:
|
||||
void onSizeHint(SizeHintEvent& ev) override {
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
ui::Style* style = theme->newStyles.newsItem();
|
||||
ui::Style* style = theme->styles.newsItem();
|
||||
|
||||
setText(m_title);
|
||||
gfx::Size sz = theme->calcSizeHint(this, style);
|
||||
@ -143,8 +143,8 @@ protected:
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
Graphics* g = ev.graphics();
|
||||
gfx::Rect bounds = clientBounds();
|
||||
ui::Style* style = theme->newStyles.newsItem();
|
||||
ui::Style* styleDetail = theme->newStyles.newsItemDetail();
|
||||
ui::Style* style = theme->styles.newsItem();
|
||||
ui::Style* styleDetail = theme->styles.newsItemDetail();
|
||||
|
||||
setText(m_title);
|
||||
gfx::Size textSize = theme->calcSizeHint(this, style);
|
||||
|
@ -40,7 +40,7 @@ private:
|
||||
|
||||
Notifications::Notifications()
|
||||
: Button("")
|
||||
, m_flagStyle(skin::SkinTheme::instance()->newStyles.flag())
|
||||
, m_flagStyle(skin::SkinTheme::instance()->styles.flag())
|
||||
, m_withNotifications(false)
|
||||
{
|
||||
}
|
||||
|
@ -553,7 +553,7 @@ void PaletteView::onPaint(ui::PaintEvent& ev)
|
||||
|
||||
// Draw the selection
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.colorbarSelection(), box, info);
|
||||
g, theme->styles.colorbarSelection(), box, info);
|
||||
}
|
||||
|
||||
++j;
|
||||
|
@ -43,15 +43,15 @@ public:
|
||||
, m_fullpath(file)
|
||||
, m_name(base::get_file_name(file))
|
||||
, m_path(base::get_file_path(file)) {
|
||||
setStyle(SkinTheme::instance()->newStyles.recentItem());
|
||||
setStyle(SkinTheme::instance()->styles.recentItem());
|
||||
}
|
||||
|
||||
protected:
|
||||
void onSizeHint(SizeHintEvent& ev) override {
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
ui::Style* style = theme->newStyles.recentFile();
|
||||
ui::Style* styleDetail = theme->newStyles.recentFileDetail();
|
||||
|
||||
ui::Style* style = theme->styles.recentFile();
|
||||
ui::Style* styleDetail = theme->styles.recentFileDetail();
|
||||
|
||||
setText(m_name);
|
||||
gfx::Size sz1 = theme->calcSizeHint(this, style);
|
||||
|
||||
@ -65,8 +65,8 @@ protected:
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
Graphics* g = ev.graphics();
|
||||
gfx::Rect bounds = clientBounds();
|
||||
ui::Style* style = theme->newStyles.recentFile();
|
||||
ui::Style* styleDetail = theme->newStyles.recentFileDetail();
|
||||
ui::Style* style = theme->styles.recentFile();
|
||||
ui::Style* styleDetail = theme->styles.recentFileDetail();
|
||||
|
||||
setText(m_name.c_str());
|
||||
theme->paintWidget(g, this, style, bounds);
|
||||
|
@ -756,13 +756,13 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
switch (widget->type()) {
|
||||
|
||||
case kBoxWidget:
|
||||
widget->setStyle(newStyles.box());
|
||||
widget->setStyle(styles.box());
|
||||
BORDER(0);
|
||||
widget->setChildSpacing(4 * scale);
|
||||
break;
|
||||
|
||||
case kButtonWidget:
|
||||
widget->setStyle(newStyles.button());
|
||||
widget->setStyle(styles.button());
|
||||
break;
|
||||
|
||||
case kCheckWidget:
|
||||
@ -786,17 +786,17 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
break;
|
||||
|
||||
case kGridWidget:
|
||||
widget->setStyle(newStyles.grid());
|
||||
widget->setStyle(styles.grid());
|
||||
BORDER(0);
|
||||
widget->setChildSpacing(4 * scale);
|
||||
break;
|
||||
|
||||
case kLabelWidget:
|
||||
widget->setStyle(newStyles.label());
|
||||
widget->setStyle(styles.label());
|
||||
break;
|
||||
|
||||
case kLinkLabelWidget:
|
||||
widget->setStyle(newStyles.link());
|
||||
widget->setStyle(styles.link());
|
||||
break;
|
||||
|
||||
case kListBoxWidget:
|
||||
@ -811,20 +811,20 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
case kComboBoxWidget: {
|
||||
ComboBox* combobox = static_cast<ComboBox*>(widget);
|
||||
Button* button = combobox->getButtonWidget();
|
||||
button->setStyle(newStyles.comboboxButton());
|
||||
button->setStyle(styles.comboboxButton());
|
||||
break;
|
||||
}
|
||||
|
||||
case kMenuWidget:
|
||||
widget->setStyle(newStyles.menu());
|
||||
widget->setStyle(styles.menu());
|
||||
break;
|
||||
|
||||
case kMenuBarWidget:
|
||||
widget->setStyle(newStyles.menubar());
|
||||
widget->setStyle(styles.menubar());
|
||||
break;
|
||||
|
||||
case kMenuBoxWidget:
|
||||
widget->setStyle(newStyles.menubox());
|
||||
widget->setStyle(styles.menubox());
|
||||
break;
|
||||
|
||||
case kMenuItemWidget:
|
||||
@ -834,7 +834,7 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
|
||||
case kSplitterWidget:
|
||||
widget->setChildSpacing(3 * scale);
|
||||
widget->setStyle(newStyles.splitter());
|
||||
widget->setStyle(styles.splitter());
|
||||
break;
|
||||
|
||||
case kRadioWidget:
|
||||
@ -852,13 +852,13 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
// Horizontal bar
|
||||
if (widget->align() & HORIZONTAL) {
|
||||
if (dynamic_cast<MenuSeparator*>(widget))
|
||||
widget->setStyle(newStyles.menuSeparator());
|
||||
widget->setStyle(styles.menuSeparator());
|
||||
else
|
||||
widget->setStyle(newStyles.horizontalSeparator());
|
||||
widget->setStyle(styles.horizontalSeparator());
|
||||
}
|
||||
// Vertical bar
|
||||
else {
|
||||
widget->setStyle(newStyles.verticalSeparator());
|
||||
widget->setStyle(styles.verticalSeparator());
|
||||
}
|
||||
break;
|
||||
|
||||
@ -881,12 +881,12 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
case kViewWidget:
|
||||
widget->setChildSpacing(0);
|
||||
widget->setBgColor(colors.windowFace());
|
||||
widget->setStyle(newStyles.view());
|
||||
widget->setStyle(styles.view());
|
||||
break;
|
||||
|
||||
case kViewScrollbarWidget:
|
||||
widget->setStyle(newStyles.scrollbar());
|
||||
static_cast<ScrollBar*>(widget)->setThumbStyle(newStyles.scrollbarThumb());
|
||||
widget->setStyle(styles.scrollbar());
|
||||
static_cast<ScrollBar*>(widget)->setThumbStyle(styles.scrollbarThumb());
|
||||
break;
|
||||
|
||||
case kViewViewportWidget:
|
||||
@ -895,40 +895,40 @@ void SkinTheme::initWidget(Widget* widget)
|
||||
break;
|
||||
|
||||
case kManagerWidget:
|
||||
widget->setStyle(newStyles.desktop());
|
||||
widget->setStyle(styles.desktop());
|
||||
break;
|
||||
|
||||
case kWindowWidget:
|
||||
if (TipWindow* window = dynamic_cast<TipWindow*>(widget)) {
|
||||
window->setStyle(newStyles.tooltipWindow());
|
||||
window->setArrowStyle(newStyles.tooltipWindowArrow());
|
||||
window->textBox()->setStyle(SkinTheme::instance()->newStyles.tooltipText());
|
||||
window->setStyle(styles.tooltipWindow());
|
||||
window->setArrowStyle(styles.tooltipWindowArrow());
|
||||
window->textBox()->setStyle(SkinTheme::instance()->styles.tooltipText());
|
||||
}
|
||||
else if (dynamic_cast<TransparentPopupWindow*>(widget)) {
|
||||
widget->setStyle(newStyles.transparentPopupWindow());
|
||||
widget->setStyle(styles.transparentPopupWindow());
|
||||
}
|
||||
else if (dynamic_cast<PopupWindow*>(widget)) {
|
||||
widget->setStyle(newStyles.popupWindow());
|
||||
widget->setStyle(styles.popupWindow());
|
||||
}
|
||||
else if (static_cast<Window*>(widget)->isDesktop()) {
|
||||
widget->setStyle(newStyles.desktop());
|
||||
widget->setStyle(styles.desktop());
|
||||
}
|
||||
else {
|
||||
if (widget->hasText()) {
|
||||
widget->setStyle(newStyles.windowWithTitle());
|
||||
widget->setStyle(styles.windowWithTitle());
|
||||
}
|
||||
else {
|
||||
widget->setStyle(newStyles.windowWithoutTitle());
|
||||
widget->setStyle(styles.windowWithoutTitle());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kWindowTitleLabelWidget:
|
||||
widget->setStyle(SkinTheme::instance()->newStyles.windowTitleLabel());
|
||||
widget->setStyle(SkinTheme::instance()->styles.windowTitleLabel());
|
||||
break;
|
||||
|
||||
case kWindowCloseButtonWidget:
|
||||
widget->setStyle(SkinTheme::instance()->newStyles.windowCloseButton());
|
||||
widget->setStyle(SkinTheme::instance()->styles.windowCloseButton());
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -83,7 +83,7 @@ namespace app {
|
||||
void drawVline(ui::Graphics* g, const gfx::Rect& rc, SkinPart* skinPart);
|
||||
void paintProgressBar(ui::Graphics* g, const gfx::Rect& rc, double progress);
|
||||
|
||||
ui::Style* getNewStyle(const std::string& id) {
|
||||
ui::Style* getStyleById(const std::string& id) {
|
||||
return m_styles[id];
|
||||
}
|
||||
|
||||
|
@ -547,7 +547,7 @@ StatusBar::StatusBar()
|
||||
m_currentFrame = new GotoFrameEntry();
|
||||
m_newFrame = new Button("+");
|
||||
m_newFrame->Click.connect(base::Bind<void>(&StatusBar::newFrame, this));
|
||||
m_newFrame->setStyle(theme->newStyles.newFrameButton());
|
||||
m_newFrame->setStyle(theme->styles.newFrameButton());
|
||||
m_zoomEntry = new ZoomEntry;
|
||||
m_zoomEntry->ZoomChange.connect(&StatusBar::onChangeZoom, this);
|
||||
|
||||
|
@ -63,7 +63,7 @@ Tabs::Tabs(TabsDelegate* delegate)
|
||||
enableFlags(CTRL_RIGHT_CLICK);
|
||||
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(this->theme());
|
||||
setStyle(theme->newStyles.mainTabs());
|
||||
setStyle(theme->styles.mainTabs());
|
||||
setDoubleBuffered(true);
|
||||
initTheme();
|
||||
|
||||
@ -255,7 +255,7 @@ void Tabs::setDockedStyle()
|
||||
m_tabsHeight = theme->dimensions.dockedTabsHeight();
|
||||
m_tabsBottomHeight = 0;
|
||||
|
||||
setStyle(theme->newStyles.workspaceTabs());
|
||||
setStyle(theme->styles.workspaceTabs());
|
||||
}
|
||||
|
||||
void Tabs::setDropViewPreview(const gfx::Point& pos, TabView* view)
|
||||
@ -574,7 +574,7 @@ void Tabs::drawTab(Graphics* g, const gfx::Rect& _box,
|
||||
(selected ? ui::Style::Layer::kFocus: 0) |
|
||||
(hover ? ui::Style::Layer::kMouse: 0);
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tab(),
|
||||
g, theme->styles.tab(),
|
||||
gfx::Rect(box.x, box.y+dy, box.w, box.h),
|
||||
info);
|
||||
|
||||
@ -590,7 +590,7 @@ void Tabs::drawTab(Graphics* g, const gfx::Rect& _box,
|
||||
case TabIcon::HOME:
|
||||
{
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tabHome(),
|
||||
g, theme->styles.tabHome(),
|
||||
gfx::Rect(
|
||||
box.x,
|
||||
box.y+dy,
|
||||
@ -606,7 +606,7 @@ void Tabs::drawTab(Graphics* g, const gfx::Rect& _box,
|
||||
if (box.w > 8*ui::guiscale()) {
|
||||
info.text = &tab->text;
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tabText(),
|
||||
g, theme->styles.tabText(),
|
||||
gfx::Rect(box.x+dx, box.y+dy, box.w-dx, box.h),
|
||||
info);
|
||||
info.text = nullptr;
|
||||
@ -616,14 +616,14 @@ void Tabs::drawTab(Graphics* g, const gfx::Rect& _box,
|
||||
// Tab bottom part
|
||||
if (!m_docked) {
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tabBottom(),
|
||||
g, theme->styles.tabBottom(),
|
||||
gfx::Rect(box.x, box.y2(), box.w, bounds().y2()-box.y2()),
|
||||
info);
|
||||
}
|
||||
|
||||
// Close button
|
||||
if (!closeBox.isEmpty()) {
|
||||
ui::Style* style = theme->newStyles.tabCloseIcon();
|
||||
ui::Style* style = theme->styles.tabCloseIcon();
|
||||
|
||||
if (m_delegate) {
|
||||
if (tab->view)
|
||||
@ -631,7 +631,7 @@ void Tabs::drawTab(Graphics* g, const gfx::Rect& _box,
|
||||
|
||||
if (tab->modified &&
|
||||
(!hover || !m_hotCloseButton)) {
|
||||
style = theme->newStyles.tabModifiedIcon();
|
||||
style = theme->styles.tabModifiedIcon();
|
||||
}
|
||||
}
|
||||
|
||||
@ -654,12 +654,12 @@ void Tabs::drawFiller(ui::Graphics* g, const gfx::Rect& box)
|
||||
gfx::Rect rect = clientBounds();
|
||||
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tabFiller(),
|
||||
g, theme->styles.tabFiller(),
|
||||
gfx::Rect(box.x, box.y, rect.x2()-box.x, box.h),
|
||||
PaintWidgetPartInfo());
|
||||
|
||||
theme->paintWidgetPart(
|
||||
g, theme->newStyles.tabBottom(),
|
||||
g, theme->styles.tabBottom(),
|
||||
gfx::Rect(box.x, box.y2(), rect.x2()-box.x, rect.y2()-box.y2()),
|
||||
PaintWidgetPartInfo());
|
||||
}
|
||||
|
@ -164,10 +164,10 @@ Timeline::Timeline()
|
||||
m_vbar.setBarWidth(barsize);
|
||||
m_hbar.setTransparent(true);
|
||||
m_vbar.setTransparent(true);
|
||||
m_hbar.setStyle(theme->newStyles.transparentScrollbar());
|
||||
m_vbar.setStyle(theme->newStyles.transparentScrollbar());
|
||||
m_hbar.setThumbStyle(theme->newStyles.transparentScrollbarThumb());
|
||||
m_vbar.setThumbStyle(theme->newStyles.transparentScrollbarThumb());
|
||||
m_hbar.setStyle(theme->styles.transparentScrollbar());
|
||||
m_vbar.setStyle(theme->styles.transparentScrollbar());
|
||||
m_hbar.setThumbStyle(theme->styles.transparentScrollbarThumb());
|
||||
m_vbar.setThumbStyle(theme->styles.transparentScrollbarThumb());
|
||||
}
|
||||
|
||||
Timeline::~Timeline()
|
||||
@ -1178,7 +1178,7 @@ void Timeline::onPaint(ui::PaintEvent& ev)
|
||||
if (!bounds.isEmpty()) {
|
||||
drawPart(
|
||||
g, bounds, nullptr,
|
||||
skinTheme()->newStyles.timelineOnionskinRange(),
|
||||
skinTheme()->styles.timelineOnionskinRange(),
|
||||
false, false, false);
|
||||
}
|
||||
}
|
||||
@ -1291,7 +1291,7 @@ paintNoDoc:;
|
||||
if (noDoc)
|
||||
drawPart(
|
||||
g, clientBounds(), nullptr,
|
||||
skinTheme()->newStyles.timelinePadding());
|
||||
skinTheme()->styles.timelinePadding());
|
||||
}
|
||||
|
||||
void Timeline::onAfterCommandExecution(CommandExecutionEvent& ev)
|
||||
@ -1552,7 +1552,7 @@ void Timeline::drawTop(ui::Graphics* g)
|
||||
|
||||
void Timeline::drawHeader(ui::Graphics* g)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
bool allInvisible = allLayersInvisible();
|
||||
bool allLocked = allLayersLocked();
|
||||
bool allContinuous = allLayersContinuous();
|
||||
@ -1611,13 +1611,13 @@ void Timeline::drawHeaderFrame(ui::Graphics* g, frame_t frame)
|
||||
(docPref().timeline.firstFrame()+frame) % 100);
|
||||
|
||||
drawPart(g, bounds, &text,
|
||||
skinTheme()->newStyles.timelineHeaderFrame(),
|
||||
skinTheme()->styles.timelineHeaderFrame(),
|
||||
is_active, is_hover, is_clicked);
|
||||
}
|
||||
|
||||
void Timeline::drawLayer(ui::Graphics* g, int layerIdx)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
Layer* layer = m_layers[layerIdx].layer;
|
||||
bool is_active = isLayerActive(layerIdx);
|
||||
bool hotlayer = (m_hot.layer == layerIdx);
|
||||
@ -1745,7 +1745,7 @@ void Timeline::drawLayer(ui::Graphics* g, int layerIdx)
|
||||
|
||||
void Timeline::drawCel(ui::Graphics* g, layer_t layerIndex, frame_t frame, Cel* cel, DrawCelData* data)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
Layer* layer = m_layers[layerIndex].layer;
|
||||
Image* image = (cel ? cel->image(): nullptr);
|
||||
bool is_hover = (m_hot.part == PART_CEL &&
|
||||
@ -1954,7 +1954,7 @@ void Timeline::drawCelLinkDecorators(ui::Graphics* g, const gfx::Rect& full_boun
|
||||
Cel* cel, frame_t frame, bool is_active, bool is_hover,
|
||||
DrawCelData* data)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
ObjectId imageId = (*data->activeIt)->image()->id();
|
||||
|
||||
gfx::Rect bounds = gfx::Rect(full_bounds).setSize(gfx::Size(headerBoxWidth(), headerBoxHeight()));
|
||||
@ -2000,7 +2000,7 @@ void Timeline::drawFrameTags(ui::Graphics* g)
|
||||
return;
|
||||
|
||||
SkinTheme* theme = skinTheme();
|
||||
auto& styles = theme->newStyles;
|
||||
auto& styles = theme->styles;
|
||||
|
||||
g->fillRect(theme->colors.workspace(),
|
||||
gfx::Rect(
|
||||
@ -2052,7 +2052,7 @@ void Timeline::drawFrameTags(ui::Graphics* g)
|
||||
|
||||
void Timeline::drawRangeOutline(ui::Graphics* g)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
|
||||
gfx::Rect clipBounds;
|
||||
switch (m_range.type()) {
|
||||
@ -2125,7 +2125,7 @@ void Timeline::drawRangeOutline(ui::Graphics* g)
|
||||
|
||||
void Timeline::drawPaddings(ui::Graphics* g)
|
||||
{
|
||||
auto& styles = skinTheme()->newStyles;
|
||||
auto& styles = skinTheme()->styles;
|
||||
|
||||
gfx::Rect client = clientBounds();
|
||||
gfx::Rect bottomLayer;
|
||||
|
@ -267,7 +267,7 @@ DropViewAtResult WorkspacePanel::dropViewAt(const gfx::Point& pos, WorkspacePane
|
||||
|
||||
Splitter* splitter = new Splitter(Splitter::ByPercentage, splitterAlign);
|
||||
splitter->setExpansive(true);
|
||||
splitter->setStyle(SkinTheme::instance()->newStyles.workspaceSplitter());
|
||||
splitter->setStyle(SkinTheme::instance()->styles.workspaceSplitter());
|
||||
|
||||
Widget* parent = this->parent();
|
||||
if (parent->type() == kBoxWidget) {
|
||||
|
@ -575,7 +575,7 @@ void WidgetLoader::fillWidgetWithXmlElementAttributes(const TiXmlElement* elem,
|
||||
|
||||
if (styleid) {
|
||||
SkinTheme* theme = static_cast<SkinTheme*>(root->theme());
|
||||
ui::Style* style = theme->getNewStyle(styleid);
|
||||
ui::Style* style = theme->getStyleById(styleid);
|
||||
if (style)
|
||||
widget->setStyle(style);
|
||||
else
|
||||
|
@ -17,7 +17,7 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
std::vector<std::string> dimensions;
|
||||
std::vector<std::string> colors;
|
||||
std::vector<std::string> parts;
|
||||
std::vector<std::string> newStyles;
|
||||
std::vector<std::string> styles;
|
||||
|
||||
TiXmlHandle handle(doc);
|
||||
TiXmlElement* elem = handle
|
||||
@ -57,7 +57,7 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
.FirstChild("style").ToElement();
|
||||
while (elem) {
|
||||
const char* id = elem->Attribute("id");
|
||||
newStyles.push_back(id);
|
||||
styles.push_back(id);
|
||||
elem = elem->NextSiblingElement();
|
||||
}
|
||||
|
||||
@ -139,17 +139,17 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
// New styles sub class
|
||||
std::cout
|
||||
<< "\n"
|
||||
<< " class NewStyles {\n"
|
||||
<< " class Styles {\n"
|
||||
<< " template<typename> friend class ThemeFile;\n"
|
||||
<< " public:\n";
|
||||
for (auto style : newStyles) {
|
||||
for (auto style : styles) {
|
||||
std::string id = convert_xmlid_to_cppid(style, false);
|
||||
std::cout
|
||||
<< " ui::Style* " << id << "() const { return m_" << id << "; }\n";
|
||||
}
|
||||
std::cout
|
||||
<< " private:\n";
|
||||
for (auto style : newStyles) {
|
||||
for (auto style : styles) {
|
||||
std::string id = convert_xmlid_to_cppid(style, false);
|
||||
std::cout
|
||||
<< " ui::Style* m_" << id << ";\n";
|
||||
@ -162,7 +162,7 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
<< " Dimensions dimensions;\n"
|
||||
<< " Colors colors;\n"
|
||||
<< " Parts parts;\n"
|
||||
<< " NewStyles newStyles;\n"
|
||||
<< " Styles styles;\n"
|
||||
<< "\n"
|
||||
<< " protected:\n"
|
||||
<< " void updateInternals() {\n";
|
||||
@ -181,10 +181,10 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
std::cout << " byId(parts.m_" << id
|
||||
<< ", \"" << part << "\");\n";
|
||||
}
|
||||
for (auto newStyle : newStyles) {
|
||||
std::string id = convert_xmlid_to_cppid(newStyle, false);
|
||||
std::cout << " byId(newStyles.m_" << id
|
||||
<< ", \"" << newStyle << "\");\n";
|
||||
for (auto style : styles) {
|
||||
std::string id = convert_xmlid_to_cppid(style, false);
|
||||
std::cout << " byId(styles.m_" << id
|
||||
<< ", \"" << style << "\");\n";
|
||||
}
|
||||
std::cout
|
||||
<< " }\n"
|
||||
@ -200,7 +200,7 @@ void gen_theme_class(TiXmlDocument* doc, const std::string& inputFn)
|
||||
<< " part = static_cast<T*>(this)->getPartById(id);\n"
|
||||
<< " }\n"
|
||||
<< " void byId(ui::Style*& style, const std::string& id) {\n"
|
||||
<< " style = static_cast<T*>(this)->getNewStyle(id);\n"
|
||||
<< " style = static_cast<T*>(this)->getStyleById(id);\n"
|
||||
<< " }\n";
|
||||
|
||||
std::cout
|
||||
|
Loading…
x
Reference in New Issue
Block a user