mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-24 18:02:27 +00:00
Handle toolbar in small sizes with overflow button
This commit is contained in:
parent
e1652e0585
commit
9b90159d1b
@ -581,7 +581,7 @@ fast_rotation = Fast Rotation
|
|||||||
rotsprite = RotSprite
|
rotsprite = RotSprite
|
||||||
pixel_perfect = Pixel-perfect
|
pixel_perfect = Pixel-perfect
|
||||||
linear_gradient = Linear Gradient
|
linear_gradient = Linear Gradient
|
||||||
radial_gradient = Radial Gradiant
|
radial_gradient = Radial Gradient
|
||||||
drop_pixel = Drop pixels here (Enter)
|
drop_pixel = Drop pixels here (Enter)
|
||||||
cancel_drag = Cancel drag and drop (Esc)
|
cancel_drag = Cancel drag and drop (Esc)
|
||||||
auto_select_layer = Auto Select Layer
|
auto_select_layer = Auto Select Layer
|
||||||
@ -810,6 +810,7 @@ unknown = Unknown
|
|||||||
same_in_all_tools = Same in all Tools
|
same_in_all_tools = Same in all Tools
|
||||||
opacity = Opacity:
|
opacity = Opacity:
|
||||||
tolerance = Tolerance:
|
tolerance = Tolerance:
|
||||||
|
show_more = Show more...
|
||||||
|
|
||||||
[gif_options]
|
[gif_options]
|
||||||
title = GIF Options
|
title = GIF Options
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include "app/modules/gfx.h"
|
#include "app/modules/gfx.h"
|
||||||
#include "app/tools/active_tool.h"
|
#include "app/tools/active_tool.h"
|
||||||
#include "app/tools/tool_box.h"
|
#include "app/tools/tool_box.h"
|
||||||
|
#include "app/tools/tool_group.h"
|
||||||
#include "app/ui/keyboard_shortcuts.h"
|
#include "app/ui/keyboard_shortcuts.h"
|
||||||
#include "app/ui/main_window.h"
|
#include "app/ui/main_window.h"
|
||||||
#include "app/ui/preview_editor.h"
|
#include "app/ui/preview_editor.h"
|
||||||
@ -94,6 +95,7 @@ ToolBar::ToolBar()
|
|||||||
m_currentStrip = NULL;
|
m_currentStrip = NULL;
|
||||||
m_tipWindow = NULL;
|
m_tipWindow = NULL;
|
||||||
m_tipOpened = false;
|
m_tipOpened = false;
|
||||||
|
m_minHeight = 0;
|
||||||
|
|
||||||
ToolBox* toolbox = App::instance()->toolBox();
|
ToolBox* toolbox = App::instance()->toolBox();
|
||||||
for (Tool* tool : *toolbox) {
|
for (Tool* tool : *toolbox) {
|
||||||
@ -120,12 +122,22 @@ bool ToolBar::isToolVisible(Tool* tool)
|
|||||||
bool ToolBar::onProcessMessage(Message* msg)
|
bool ToolBar::onProcessMessage(Message* msg)
|
||||||
{
|
{
|
||||||
switch (msg->type()) {
|
switch (msg->type()) {
|
||||||
|
case kPaintMessage: {
|
||||||
|
auto toolbox = App::instance()->toolBox();
|
||||||
|
auto lastToolBounds = getToolGroupBounds(toolbox->getGroupsCount());
|
||||||
|
int minHeight = lastToolBounds.y + lastToolBounds.h;
|
||||||
|
|
||||||
|
if (minHeight != m_minHeight) {
|
||||||
|
m_minHeight = minHeight;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
} break;
|
||||||
case kMouseDownMessage: {
|
case kMouseDownMessage: {
|
||||||
auto mouseMsg = static_cast<const MouseMessage*>(msg);
|
auto mouseMsg = static_cast<const MouseMessage*>(msg);
|
||||||
const Point mousePos = mouseMsg->positionForDisplay(display());
|
const Point mousePos = mouseMsg->positionForDisplay(display());
|
||||||
ToolBox* toolbox = App::instance()->toolBox();
|
ToolBox* toolbox = App::instance()->toolBox();
|
||||||
int groups = toolbox->getGroupsCount();
|
int hidden = getHiddenGroups();
|
||||||
|
int groups = toolbox->getGroupsCount() - hidden;
|
||||||
Rect toolrc;
|
Rect toolrc;
|
||||||
|
|
||||||
ToolGroupList::iterator it = toolbox->begin_group();
|
ToolGroupList::iterator it = toolbox->begin_group();
|
||||||
@ -134,8 +146,7 @@ bool ToolBar::onProcessMessage(Message* msg)
|
|||||||
Tool* tool = m_selectedInGroup[tool_group];
|
Tool* tool = m_selectedInGroup[tool_group];
|
||||||
|
|
||||||
toolrc = getToolGroupBounds(c);
|
toolrc = getToolGroupBounds(c);
|
||||||
if (mousePos.y >= toolrc.y &&
|
if (mousePos.y >= toolrc.y && mousePos.y < toolrc.y + toolrc.h) {
|
||||||
mousePos.y < toolrc.y+toolrc.h) {
|
|
||||||
selectTool(tool);
|
selectTool(tool);
|
||||||
|
|
||||||
openPopupWindow(c, tool_group);
|
openPopupWindow(c, tool_group);
|
||||||
@ -147,6 +158,20 @@ bool ToolBar::onProcessMessage(Message* msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hidden > 0) {
|
||||||
|
toolrc = getToolGroupBounds(groups);
|
||||||
|
if (mousePos.y >= toolrc.y && mousePos.y < toolrc.y + toolrc.h) {
|
||||||
|
if (m_popupWindow &&
|
||||||
|
m_popupWindow->firstChild()->type() == WidgetType::kBoxWidget) {
|
||||||
|
closePopupWindow();
|
||||||
|
closeTipWindow();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
showHiddenToolPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
toolrc = getToolGroupBounds(PreviewVisibilityIndex);
|
toolrc = getToolGroupBounds(PreviewVisibilityIndex);
|
||||||
if (mousePos.y >= toolrc.y &&
|
if (mousePos.y >= toolrc.y &&
|
||||||
mousePos.y < toolrc.y+toolrc.h) {
|
mousePos.y < toolrc.y+toolrc.h) {
|
||||||
@ -171,7 +196,8 @@ bool ToolBar::onProcessMessage(Message* msg)
|
|||||||
auto mouseMsg = static_cast<const MouseMessage*>(msg);
|
auto mouseMsg = static_cast<const MouseMessage*>(msg);
|
||||||
const Point mousePos = mouseMsg->positionForDisplay(display());
|
const Point mousePos = mouseMsg->positionForDisplay(display());
|
||||||
ToolBox* toolbox = App::instance()->toolBox();
|
ToolBox* toolbox = App::instance()->toolBox();
|
||||||
int groups = toolbox->getGroupsCount();
|
int hidden = getHiddenGroups();
|
||||||
|
int groups = toolbox->getGroupsCount() - hidden;
|
||||||
Tool* new_hot_tool = NULL;
|
Tool* new_hot_tool = NULL;
|
||||||
int new_hot_index = NoneIndex;
|
int new_hot_index = NoneIndex;
|
||||||
Rect toolrc;
|
Rect toolrc;
|
||||||
@ -195,6 +221,13 @@ bool ToolBar::onProcessMessage(Message* msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hidden > 0) {
|
||||||
|
toolrc = getToolGroupBounds(groups);
|
||||||
|
if (mousePos.y >= toolrc.y && mousePos.y < toolrc.y + toolrc.h) {
|
||||||
|
openTipWindow(groups, nullptr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
toolrc = getToolGroupBounds(PreviewVisibilityIndex);
|
toolrc = getToolGroupBounds(PreviewVisibilityIndex);
|
||||||
if (mousePos.y >= toolrc.y &&
|
if (mousePos.y >= toolrc.y &&
|
||||||
mousePos.y < toolrc.y+toolrc.h) {
|
mousePos.y < toolrc.y+toolrc.h) {
|
||||||
@ -289,7 +322,6 @@ bool ToolBar::onProcessMessage(Message* msg)
|
|||||||
m_tipOpened = true;
|
m_tipOpened = true;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Widget::onProcessMessage(msg);
|
return Widget::onProcessMessage(msg);
|
||||||
@ -301,6 +333,11 @@ void ToolBar::onSizeHint(SizeHintEvent& ev)
|
|||||||
iconsize.w += border().width();
|
iconsize.w += border().width();
|
||||||
iconsize.h += border().height();
|
iconsize.h += border().height();
|
||||||
ev.setSizeHint(iconsize);
|
ev.setSizeHint(iconsize);
|
||||||
|
|
||||||
|
if (m_popupWindow) {
|
||||||
|
closePopupWindow();
|
||||||
|
closeTipWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBar::onPaint(ui::PaintEvent& ev)
|
void ToolBar::onPaint(ui::PaintEvent& ev)
|
||||||
@ -318,7 +355,9 @@ void ToolBar::onPaint(ui::PaintEvent& ev)
|
|||||||
|
|
||||||
g->fillRect(theme->colors.tabActiveFace(), bounds);
|
g->fillRect(theme->colors.tabActiveFace(), bounds);
|
||||||
|
|
||||||
for (int c=0; c<groups; ++c, ++it) {
|
int hiddenGroups = getHiddenGroups();
|
||||||
|
int visibleGroupCount = groups - hiddenGroups;
|
||||||
|
for (int c = 0; c < visibleGroupCount; ++c, ++it) {
|
||||||
ToolGroup* tool_group = *it;
|
ToolGroup* tool_group = *it;
|
||||||
Tool* tool = m_selectedInGroup[tool_group];
|
Tool* tool = m_selectedInGroup[tool_group];
|
||||||
|
|
||||||
@ -335,20 +374,32 @@ void ToolBar::onPaint(ui::PaintEvent& ev)
|
|||||||
drawToolIcon(g, c, nw, icon);
|
drawToolIcon(g, c, nw, icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hiddenGroups > 0) {
|
||||||
|
int lastGroup = visibleGroupCount;
|
||||||
|
Rect toolrc = getToolGroupBounds(lastGroup);
|
||||||
|
toolrc.offset(-origin());
|
||||||
|
|
||||||
|
nw = (m_hotIndex >= visibleGroupCount) ? theme->parts.toolbuttonHot() :
|
||||||
|
theme->parts.toolbuttonLast();
|
||||||
|
|
||||||
|
theme->drawRect(g, toolrc, nw.get());
|
||||||
|
icon = theme->parts.listView()->bitmap(0);
|
||||||
|
|
||||||
|
drawToolIcon(g, lastGroup, nw, icon);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw button to show/hide preview
|
// Draw button to show/hide preview
|
||||||
const auto mainWindow = App::instance()->mainWindow();
|
const auto mainWindow = App::instance()->mainWindow();
|
||||||
bool isHot = (m_hotIndex == PreviewVisibilityIndex ||
|
bool isHot = (m_hotIndex == PreviewVisibilityIndex ||
|
||||||
mainWindow->getPreviewEditor()->isPreviewEnabled());
|
mainWindow->getPreviewEditor()->isPreviewEnabled());
|
||||||
nw = isHot ? theme->parts.toolbuttonHot():
|
nw = isHot ? theme->parts.toolbuttonHot() : theme->parts.toolbuttonNormal();
|
||||||
theme->parts.toolbuttonNormal();
|
|
||||||
icon = theme->getToolIcon("minieditor");
|
icon = theme->getToolIcon("minieditor");
|
||||||
drawToolIcon(g, PreviewVisibilityIndex, nw, icon);
|
drawToolIcon(g, PreviewVisibilityIndex, nw, icon);
|
||||||
|
|
||||||
// Draw button to show/hide timeline
|
// Draw button to show/hide timeline
|
||||||
isHot = (m_hotIndex == TimelineVisibilityIndex ||
|
isHot = (m_hotIndex == TimelineVisibilityIndex ||
|
||||||
mainWindow->getTimelineVisibility());
|
mainWindow->getTimelineVisibility());
|
||||||
nw = isHot ? theme->parts.toolbuttonHot():
|
nw = isHot ? theme->parts.toolbuttonHot() : theme->parts.toolbuttonLast();
|
||||||
theme->parts.toolbuttonLast();
|
|
||||||
icon = theme->getToolIcon("timeline");
|
icon = theme->getToolIcon("timeline");
|
||||||
drawToolIcon(g, TimelineVisibilityIndex, nw, icon);
|
drawToolIcon(g, TimelineVisibilityIndex, nw, icon);
|
||||||
}
|
}
|
||||||
@ -457,7 +508,6 @@ Rect ToolBar::getToolGroupBounds(int group_index)
|
|||||||
rc.shrink(border());
|
rc.shrink(border());
|
||||||
|
|
||||||
switch (group_index) {
|
switch (group_index) {
|
||||||
|
|
||||||
case PreviewVisibilityIndex:
|
case PreviewVisibilityIndex:
|
||||||
rc.y += rc.h - 2 * iconsize.h - 2 * guiscale();
|
rc.y += rc.h - 2 * iconsize.h - 2 * guiscale();
|
||||||
rc.h = iconsize.h + 2 * guiscale();
|
rc.h = iconsize.h + 2 * guiscale();
|
||||||
@ -506,8 +556,14 @@ void ToolBar::openTipWindow(int group_index, Tool* tool)
|
|||||||
if (m_tipWindow)
|
if (m_tipWindow)
|
||||||
closeTipWindow();
|
closeTipWindow();
|
||||||
|
|
||||||
|
int hidden = getHiddenGroups();
|
||||||
|
int groups = App::instance()->toolBox()->getGroupsCount() - hidden;
|
||||||
|
|
||||||
std::string tooltip;
|
std::string tooltip;
|
||||||
if (tool && group_index >= 0) {
|
if (!tool && hidden > 0 && group_index >= groups) {
|
||||||
|
tooltip = Strings::general_show_more();
|
||||||
|
}
|
||||||
|
else if (tool && group_index >= 0) {
|
||||||
tooltip = tool->getText();
|
tooltip = tool->getText();
|
||||||
if (tool->getTips().size() > 0) {
|
if (tool->getTips().size() > 0) {
|
||||||
tooltip += ":\n";
|
tooltip += ":\n";
|
||||||
@ -544,8 +600,7 @@ void ToolBar::openTipWindow(int group_index, Tool* tool)
|
|||||||
if (tool && m_popupWindow && m_popupWindow->isVisible())
|
if (tool && m_popupWindow && m_popupWindow->isVisible())
|
||||||
toolrc.x += arrow.x - m_popupWindow->bounds().w;
|
toolrc.x += arrow.x - m_popupWindow->bounds().w;
|
||||||
|
|
||||||
m_tipWindow->pointAt(TOP | RIGHT, toolrc,
|
m_tipWindow->pointAt(TOP | RIGHT, toolrc, ui::Manager::getDefault()->display());
|
||||||
ui::Manager::getDefault()->display());
|
|
||||||
|
|
||||||
if (m_tipOpened)
|
if (m_tipOpened)
|
||||||
m_tipWindow->openWindow();
|
m_tipWindow->openWindow();
|
||||||
@ -602,7 +657,11 @@ void ToolBar::onClosePopup()
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBar::drawToolIcon(Graphics* g, int group_index, SkinPartPtr skin, os::Surface* icon) {
|
void ToolBar::drawToolIcon(Graphics* g,
|
||||||
|
int group_index,
|
||||||
|
SkinPartPtr skin,
|
||||||
|
os::Surface* icon)
|
||||||
|
{
|
||||||
auto theme = SkinTheme::get(this);
|
auto theme = SkinTheme::get(this);
|
||||||
Rect toolrc = getToolGroupBounds(group_index);
|
Rect toolrc = getToolGroupBounds(group_index);
|
||||||
toolrc.offset(-origin());
|
toolrc.offset(-origin());
|
||||||
@ -616,6 +675,95 @@ void ToolBar::drawToolIcon(Graphics* g, int group_index, SkinPartPtr skin, os::S
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ToolBar::getHiddenGroups()
|
||||||
|
{
|
||||||
|
const int height = size().h;
|
||||||
|
if (height < m_minHeight) {
|
||||||
|
int hidden = (m_minHeight - height) / getToolIconSize(this).h;
|
||||||
|
if (hidden >= 1)
|
||||||
|
return std::clamp(hidden + 1, 2, App::instance()->toolBox()->getGroupsCount() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ToolBar::showHiddenToolPopup()
|
||||||
|
{
|
||||||
|
if (m_popupWindow) {
|
||||||
|
if (m_closeConn)
|
||||||
|
m_closeConn.disconnect();
|
||||||
|
|
||||||
|
onClosePopup();
|
||||||
|
closePopupWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
closeTipWindow();
|
||||||
|
|
||||||
|
auto toolbox = App::instance()->toolBox();
|
||||||
|
m_popupWindow = new TransparentPopupWindow(PopupWindow::ClickBehavior::CloseOnClickOutsideHotRegion);
|
||||||
|
m_closeConn = m_popupWindow->Close.connect([this] { onClosePopup(); });
|
||||||
|
|
||||||
|
std::vector<ButtonSet::Item*> items;
|
||||||
|
auto toolIconSize = getToolIconSize(this);
|
||||||
|
auto theme = SkinTheme::get(this);
|
||||||
|
ToolGroupList::iterator it = toolbox->begin_group();
|
||||||
|
|
||||||
|
for (int i = 0; i < toolbox->getGroupsCount(); ++i, ++it) {
|
||||||
|
if (i < toolbox->getGroupsCount() - getHiddenGroups())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
ToolGroup* tool_group = *it;
|
||||||
|
for (ToolIterator bit = toolbox->begin(); bit != toolbox->end(); ++bit) {
|
||||||
|
Tool* tool = *bit;
|
||||||
|
if (tool->getGroup() == tool_group) {
|
||||||
|
auto item = new ButtonSet::Item();
|
||||||
|
// TODO: Tooltip with tool->getText(), implement in ButtonSet?
|
||||||
|
item->setIcon(theme->getToolPart(tool->getId().c_str()));
|
||||||
|
item->setId(tool->getId().c_str());
|
||||||
|
item->setMaxSize(toolIconSize); // TODO: Need a better way to enforce the button/icon size, this one doesn't look great
|
||||||
|
items.push_back(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::reverse(items.begin(), items.end());
|
||||||
|
|
||||||
|
ButtonSet* hiddenTools = new ButtonSet(items.size());
|
||||||
|
for (auto* item : items)
|
||||||
|
hiddenTools->addItem(item);
|
||||||
|
hiddenTools->initTheme();
|
||||||
|
hiddenTools->ItemChange.connect([this](ButtonSet::Item* toolSelection) {
|
||||||
|
selectTool(App::instance()->toolBox()->getToolById(toolSelection->id()));
|
||||||
|
m_popupWindow->deferDelete();
|
||||||
|
m_popupWindow->closeWindow(nullptr);
|
||||||
|
m_popupWindow = nullptr;
|
||||||
|
});
|
||||||
|
|
||||||
|
VBox* box = new VBox();
|
||||||
|
box->InitTheme.connect([box] { box->noBorderNoChildSpacing(); });
|
||||||
|
box->initTheme();
|
||||||
|
|
||||||
|
box->addChild(hiddenTools);
|
||||||
|
m_popupWindow->addChild(box);
|
||||||
|
|
||||||
|
Rect rc = getToolGroupBounds(toolbox->getGroupsCount() - getHiddenGroups());
|
||||||
|
|
||||||
|
rc.setSize(box->sizeHint());
|
||||||
|
rc.x -= rc.w;
|
||||||
|
|
||||||
|
// Set hotregion of popup window
|
||||||
|
m_popupWindow->setAutoRemap(false);
|
||||||
|
ui::fit_bounds(display(), m_popupWindow, rc);
|
||||||
|
m_popupWindow->setBounds(rc);
|
||||||
|
|
||||||
|
Region rgn(m_popupWindow->boundsOnScreen().enlarge(16 * guiscale()));
|
||||||
|
rgn.createUnion(rgn, Region(boundsOnScreen()));
|
||||||
|
m_popupWindow->setHotRegion(rgn);
|
||||||
|
|
||||||
|
m_popupWindow->openWindow();
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// ToolStrip
|
// ToolStrip
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -684,8 +832,8 @@ bool ToolBar::ToolStrip::onProcessMessage(Message* msg)
|
|||||||
if (ToolBar* bar = dynamic_cast<ToolBar*>(pick)) {
|
if (ToolBar* bar = dynamic_cast<ToolBar*>(pick)) {
|
||||||
releaseMouse();
|
releaseMouse();
|
||||||
|
|
||||||
MouseMessage* mouseMsg2 = new MouseMessage(
|
MouseMessage* mouseMsg2 =
|
||||||
kMouseDownMessage,
|
new MouseMessage(kMouseDownMessage,
|
||||||
*mouseMsg,
|
*mouseMsg,
|
||||||
mouseMsg->positionForDisplay(pick->display()));
|
mouseMsg->positionForDisplay(pick->display()));
|
||||||
mouseMsg2->setRecipient(bar);
|
mouseMsg2->setRecipient(bar);
|
||||||
@ -702,7 +850,6 @@ bool ToolBar::ToolStrip::onProcessMessage(Message* msg)
|
|||||||
closeWindow();
|
closeWindow();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
return Widget::onProcessMessage(msg);
|
return Widget::onProcessMessage(msg);
|
||||||
}
|
}
|
||||||
@ -750,8 +897,7 @@ void ToolBar::ToolStrip::onPaint(PaintEvent& ev)
|
|||||||
// Draw the tool icon
|
// Draw the tool icon
|
||||||
os::Surface* icon = theme->getToolIcon(tool->getId().c_str());
|
os::Surface* icon = theme->getToolIcon(tool->getId().c_str());
|
||||||
if (icon) {
|
if (icon) {
|
||||||
g->drawRgbaSurface(
|
g->drawRgbaSurface(icon,
|
||||||
icon,
|
|
||||||
CALC_FOR_CENTER(toolrc.x, toolrc.w, icon->width()),
|
CALC_FOR_CENTER(toolrc.x, toolrc.w, icon->width()),
|
||||||
CALC_FOR_CENTER(toolrc.y, toolrc.h, icon->height()));
|
CALC_FOR_CENTER(toolrc.y, toolrc.h, icon->height()));
|
||||||
}
|
}
|
||||||
@ -764,8 +910,10 @@ Rect ToolBar::ToolStrip::getToolBounds(int index)
|
|||||||
const Rect& bounds(this->bounds());
|
const Rect& bounds(this->bounds());
|
||||||
Size iconsize = getToolIconSize(this);
|
Size iconsize = getToolIconSize(this);
|
||||||
|
|
||||||
return Rect(bounds.x+index*(iconsize.w-1*guiscale()), bounds.y,
|
return Rect(bounds.x + index * (iconsize.w - 1 * guiscale()),
|
||||||
iconsize.w, bounds.h);
|
bounds.y,
|
||||||
|
iconsize.w,
|
||||||
|
bounds.h);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolBar::onActiveToolChange(tools::Tool* tool)
|
void ToolBar::onActiveToolChange(tools::Tool* tool)
|
||||||
|
@ -65,6 +65,8 @@ namespace app {
|
|||||||
void openTipWindow(int group_index, tools::Tool* tool);
|
void openTipWindow(int group_index, tools::Tool* tool);
|
||||||
void onClosePopup();
|
void onClosePopup();
|
||||||
void drawToolIcon(ui::Graphics* g, int group_index, skin::SkinPartPtr skin, os::Surface* icon);
|
void drawToolIcon(ui::Graphics* g, int group_index, skin::SkinPartPtr skin, os::Surface* icon);
|
||||||
|
int getHiddenGroups();
|
||||||
|
void showHiddenToolPopup();
|
||||||
|
|
||||||
// ActiveToolObserver impl
|
// ActiveToolObserver impl
|
||||||
void onActiveToolChange(tools::Tool* tool) override;
|
void onActiveToolChange(tools::Tool* tool) override;
|
||||||
@ -97,6 +99,9 @@ namespace app {
|
|||||||
ui::Timer m_tipTimer;
|
ui::Timer m_tipTimer;
|
||||||
bool m_tipOpened;
|
bool m_tipOpened;
|
||||||
|
|
||||||
|
// Minimum height for all the top toolbar buttons to be visible.
|
||||||
|
int m_minHeight;
|
||||||
|
|
||||||
obs::connection m_closeConn;
|
obs::connection m_closeConn;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user