mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 05:42:32 +00:00
Fix bug drawing box/grids bgcolor on tooltip windows
This commit is contained in:
parent
3b2e76e745
commit
e2a94b094a
@ -816,6 +816,9 @@
|
|||||||
|
|
||||||
<styles>
|
<styles>
|
||||||
|
|
||||||
|
<style id="box" />
|
||||||
|
<style id="grid" />
|
||||||
|
|
||||||
<style id="window_without_title" border="3">
|
<style id="window_without_title" border="3">
|
||||||
<background color="window_face" />
|
<background color="window_face" />
|
||||||
<border part="menu" />
|
<border part="menu" />
|
||||||
|
@ -845,6 +845,7 @@ void SkinTheme::initWidget(Widget* widget)
|
|||||||
switch (widget->type()) {
|
switch (widget->type()) {
|
||||||
|
|
||||||
case kBoxWidget:
|
case kBoxWidget:
|
||||||
|
widget->setStyle(newStyles.box());
|
||||||
BORDER(0);
|
BORDER(0);
|
||||||
widget->setChildSpacing(4 * scale);
|
widget->setChildSpacing(4 * scale);
|
||||||
break;
|
break;
|
||||||
@ -874,6 +875,7 @@ void SkinTheme::initWidget(Widget* widget)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kGridWidget:
|
case kGridWidget:
|
||||||
|
widget->setStyle(newStyles.grid());
|
||||||
BORDER(0);
|
BORDER(0);
|
||||||
widget->setChildSpacing(4 * scale);
|
widget->setChildSpacing(4 * scale);
|
||||||
break;
|
break;
|
||||||
@ -1041,17 +1043,6 @@ gfx::Size SkinTheme::getEntryCaretSize(Widget* widget)
|
|||||||
return gfx::Size(2*guiscale(), widget->textHeight()+2*guiscale());
|
return gfx::Size(2*guiscale(), widget->textHeight()+2*guiscale());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkinTheme::paintBox(PaintEvent& ev)
|
|
||||||
{
|
|
||||||
Widget* widget = static_cast<Widget*>(ev.getSource());
|
|
||||||
Graphics* g = ev.graphics();
|
|
||||||
|
|
||||||
if (!widget->isTransparent() &&
|
|
||||||
!is_transparent(BGCOLOR)) {
|
|
||||||
g->fillRect(BGCOLOR, g->getClipBounds());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkinTheme::paintCheckBox(PaintEvent& ev)
|
void SkinTheme::paintCheckBox(PaintEvent& ev)
|
||||||
{
|
{
|
||||||
Graphics* g = ev.graphics();
|
Graphics* g = ev.graphics();
|
||||||
@ -1100,15 +1091,6 @@ void SkinTheme::paintCheckBox(PaintEvent& ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkinTheme::paintGrid(PaintEvent& ev)
|
|
||||||
{
|
|
||||||
Widget* widget = static_cast<Widget*>(ev.getSource());
|
|
||||||
Graphics* g = ev.graphics();
|
|
||||||
|
|
||||||
if (!is_transparent(BGCOLOR))
|
|
||||||
g->fillRect(BGCOLOR, g->getClipBounds());
|
|
||||||
}
|
|
||||||
|
|
||||||
void SkinTheme::paintEntry(PaintEvent& ev)
|
void SkinTheme::paintEntry(PaintEvent& ev)
|
||||||
{
|
{
|
||||||
Graphics* g = ev.graphics();
|
Graphics* g = ev.graphics();
|
||||||
|
@ -57,10 +57,8 @@ namespace app {
|
|||||||
int getScrollbarSize() override;
|
int getScrollbarSize() override;
|
||||||
gfx::Size getEntryCaretSize(ui::Widget* widget) override;
|
gfx::Size getEntryCaretSize(ui::Widget* widget) override;
|
||||||
|
|
||||||
void paintBox(ui::PaintEvent& ev) override;
|
|
||||||
void paintCheckBox(ui::PaintEvent& ev) override;
|
void paintCheckBox(ui::PaintEvent& ev) override;
|
||||||
void paintEntry(ui::PaintEvent& ev) override;
|
void paintEntry(ui::PaintEvent& ev) override;
|
||||||
void paintGrid(ui::PaintEvent& ev) override;
|
|
||||||
void paintListBox(ui::PaintEvent& ev) override;
|
void paintListBox(ui::PaintEvent& ev) override;
|
||||||
void paintListItem(ui::PaintEvent& ev) override;
|
void paintListItem(ui::PaintEvent& ev) override;
|
||||||
void paintMenu(ui::PaintEvent& ev) override;
|
void paintMenu(ui::PaintEvent& ev) override;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2016 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -152,9 +152,4 @@ void Box::onResize(ResizeEvent& ev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Box::onPaint(PaintEvent& ev)
|
|
||||||
{
|
|
||||||
theme()->paintBox(ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
15
src/ui/box.h
15
src/ui/box.h
@ -1,5 +1,5 @@
|
|||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2013, 2015 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
|
||||||
class Box : public Widget
|
class Box : public Widget {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
Box(int align);
|
Box(int align);
|
||||||
|
|
||||||
@ -21,23 +20,19 @@ namespace ui {
|
|||||||
// Events
|
// Events
|
||||||
void onSizeHint(SizeHintEvent& ev) override;
|
void onSizeHint(SizeHintEvent& ev) override;
|
||||||
void onResize(ResizeEvent& ev) override;
|
void onResize(ResizeEvent& ev) override;
|
||||||
void onPaint(PaintEvent& ev) override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class VBox : public Box
|
class VBox : public Box {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
VBox() : Box(VERTICAL) { }
|
VBox() : Box(VERTICAL) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class HBox : public Box
|
class HBox : public Box {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
HBox() : Box(HORIZONTAL) { }
|
HBox() : Box(HORIZONTAL) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
class BoxFiller : public Box
|
class BoxFiller : public Box {
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
BoxFiller() : Box(HORIZONTAL) {
|
BoxFiller() : Box(HORIZONTAL) {
|
||||||
this->setExpansive(true);
|
this->setExpansive(true);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2016 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -204,11 +204,6 @@ void Grid::onSizeHint(SizeHintEvent& ev)
|
|||||||
ev.setSizeHint(sz);
|
ev.setSizeHint(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Grid::onPaint(PaintEvent& ev)
|
|
||||||
{
|
|
||||||
theme()->paintGrid(ev);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Grid::sumStripSize(const std::vector<Strip>& strip, int& size)
|
void Grid::sumStripSize(const std::vector<Strip>& strip, int& size)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2013 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
@ -36,7 +36,6 @@ namespace ui {
|
|||||||
// Events
|
// Events
|
||||||
void onResize(ResizeEvent& ev) override;
|
void onResize(ResizeEvent& ev) override;
|
||||||
void onSizeHint(SizeHintEvent& ev) override;
|
void onSizeHint(SizeHintEvent& ev) override;
|
||||||
void onPaint(PaintEvent& ev) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct Cell {
|
struct Cell {
|
||||||
|
@ -53,10 +53,8 @@ namespace ui {
|
|||||||
virtual int getScrollbarSize() = 0;
|
virtual int getScrollbarSize() = 0;
|
||||||
virtual gfx::Size getEntryCaretSize(Widget* widget) = 0;
|
virtual gfx::Size getEntryCaretSize(Widget* widget) = 0;
|
||||||
|
|
||||||
virtual void paintBox(PaintEvent& ev) = 0;
|
|
||||||
virtual void paintCheckBox(PaintEvent& ev) = 0;
|
virtual void paintCheckBox(PaintEvent& ev) = 0;
|
||||||
virtual void paintEntry(PaintEvent& ev) = 0;
|
virtual void paintEntry(PaintEvent& ev) = 0;
|
||||||
virtual void paintGrid(PaintEvent& ev) = 0;
|
|
||||||
virtual void paintListBox(PaintEvent& ev) = 0;
|
virtual void paintListBox(PaintEvent& ev) = 0;
|
||||||
virtual void paintListItem(PaintEvent& ev) = 0;
|
virtual void paintListItem(PaintEvent& ev) = 0;
|
||||||
virtual void paintMenu(PaintEvent& ev) = 0;
|
virtual void paintMenu(PaintEvent& ev) = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user