mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-04 05:50:15 +00:00
Update all tabs (main Tabs and from subpanels) when a document is modified
This commit is contained in:
parent
53e572eaf5
commit
5538c5a749
@ -51,7 +51,7 @@
|
|||||||
#include "app/ui/main_window.h"
|
#include "app/ui/main_window.h"
|
||||||
#include "app/ui/status_bar.h"
|
#include "app/ui/status_bar.h"
|
||||||
#include "app/ui/toolbar.h"
|
#include "app/ui/toolbar.h"
|
||||||
#include "app/ui/workspace_tabs.h"
|
#include "app/ui/workspace.h"
|
||||||
#include "app/ui_context.h"
|
#include "app/ui_context.h"
|
||||||
#include "app/util/boundary.h"
|
#include "app/util/boundary.h"
|
||||||
#include "app/webserver.h"
|
#include "app/webserver.h"
|
||||||
@ -692,10 +692,13 @@ void app_refresh_screen()
|
|||||||
ui::Manager::getDefault()->invalidate();
|
ui::Manager::getDefault()->invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO remove app_rebuild_documents_tabs() and replace it by
|
||||||
|
// observable events in the document (so a tab can observe if the
|
||||||
|
// document is modified).
|
||||||
void app_rebuild_documents_tabs()
|
void app_rebuild_documents_tabs()
|
||||||
{
|
{
|
||||||
if (App::instance()->isGui())
|
if (App::instance()->isGui())
|
||||||
App::instance()->getMainWindow()->getTabsBar()->updateTabs();
|
App::instance()->getMainWindow()->getWorkspace()->updateTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
PixelFormat app_get_current_pixel_format()
|
PixelFormat app_get_current_pixel_format()
|
||||||
|
@ -137,6 +137,21 @@ void Workspace::duplicateActiveView()
|
|||||||
setActiveView(clone);
|
setActiveView(clone);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Workspace::updateTabs()
|
||||||
|
{
|
||||||
|
WidgetsList children = getChildren();
|
||||||
|
while (!children.empty()) {
|
||||||
|
Widget* child = children.back();
|
||||||
|
children.erase(--children.end());
|
||||||
|
|
||||||
|
if (child->getType() == WorkspacePanel::Type())
|
||||||
|
static_cast<WorkspacePanel*>(child)->tabs()->updateTabs();
|
||||||
|
|
||||||
|
for (auto subchild : child->getChildren())
|
||||||
|
children.push_back(subchild);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Workspace::onPaint(PaintEvent& ev)
|
void Workspace::onPaint(PaintEvent& ev)
|
||||||
{
|
{
|
||||||
ev.getGraphics()->fillRect(getBgColor(), getClientBounds());
|
ev.getGraphics()->fillRect(getBgColor(), getClientBounds());
|
||||||
|
@ -47,6 +47,8 @@ namespace app {
|
|||||||
void selectPreviousTab();
|
void selectPreviousTab();
|
||||||
void duplicateActiveView();
|
void duplicateActiveView();
|
||||||
|
|
||||||
|
void updateTabs();
|
||||||
|
|
||||||
// Set the preview of what could happen if we drop the given
|
// Set the preview of what could happen if we drop the given
|
||||||
// "view" at the "pos"?
|
// "view" at the "pos"?
|
||||||
DropViewPreviewResult setDropViewPreview(const gfx::Point& pos,
|
DropViewPreviewResult setDropViewPreview(const gfx::Point& pos,
|
||||||
|
Loading…
Reference in New Issue
Block a user