Skip to content

Commit

Permalink
Merge pull request #5235 from manongjohn/xsheet_breadcrumbs
Browse files Browse the repository at this point in the history
Sub-Xsheet Navigation Bar
  • Loading branch information
RodneyBaker authored Jan 2, 2024
2 parents 5b8e90e + 7e75c9a commit 0999a9e
Show file tree
Hide file tree
Showing 24 changed files with 689 additions and 43 deletions.
8 changes: 8 additions & 0 deletions stuff/config/qss/Blue/Blue.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,14 @@ Ruler {
#RenameCellField {
padding-right: 3;
}
#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid #262728;
}
#XsheetBreadcrumbs::separator:horizontal {
margin: 0 0 0 2;
}
/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */
#xsheetColumnAreaMenu_Preview {
Expand Down
8 changes: 8 additions & 0 deletions stuff/config/qss/Dark/Dark.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,14 @@ Ruler {
#RenameCellField {
padding-right: 3;
}
#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid #111111;
}
#XsheetBreadcrumbs::separator:horizontal {
margin: 0 0 0 2;
}
/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */
#xsheetColumnAreaMenu_Preview {
Expand Down
8 changes: 8 additions & 0 deletions stuff/config/qss/Default/Default.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,14 @@ Ruler {
#RenameCellField {
padding-right: 3;
}
#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid #2c2c2c;
}
#XsheetBreadcrumbs::separator:horizontal {
margin: 0 0 0 2;
}
/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */
#xsheetColumnAreaMenu_Preview {
Expand Down
9 changes: 9 additions & 0 deletions stuff/config/qss/Default/less/layouts/xsheet.less
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
padding-right: 3;
}

#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid @accent;
&::separator:horizontal {
margin: 0 0 0 2;
}
}

/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */

Expand Down
8 changes: 8 additions & 0 deletions stuff/config/qss/Light/Light.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,14 @@ Ruler {
#RenameCellField {
padding-right: 3;
}
#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid #a8a8a8;
}
#XsheetBreadcrumbs::separator:horizontal {
margin: 0 0 0 2;
}
/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */
#xsheetColumnAreaMenu_Preview {
Expand Down
8 changes: 8 additions & 0 deletions stuff/config/qss/Neutral/Neutral.qss
Original file line number Diff line number Diff line change
Expand Up @@ -2267,6 +2267,14 @@ Ruler {
#RenameCellField {
padding-right: 3;
}
#XsheetBreadcrumbs {
padding: 0 5px 0 5px;
margin: 0;
border-bottom: 1 solid #5a5a5a;
}
#XsheetBreadcrumbs::separator:horizontal {
margin: 0 0 0 2;
}
/* xsheetColumnHeader (Context Menus)
----------------------------------------------------------------------------- */
#xsheetColumnAreaMenu_Preview {
Expand Down
26 changes: 24 additions & 2 deletions toonz/sources/include/toonz/childstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include "tcommon.h"

#include "toonz/txshchildlevel.h"

#undef DVAPI
#undef DVVAR
#ifdef TOONZLIB_EXPORTS
Expand Down Expand Up @@ -36,11 +38,29 @@ class TXshChildLevel;
properties, getAncestor(), getAncestorCount(), getAncestorAffine(),
getTopXsheet().
*/

//=============================================================================
//! The Node class is a container of element necessary to define a sub-xsheet.
/*!
The class contain a pointer to \b TXsheet \b m_xsheet, two integer to
identify column
\b m_col and row \b m_row, a \b TXshChildLevelP \b m_cl and a bool \b
m_justCreated.
*/

class AncestorNode {
public:
TXsheet *m_xsheet;
int m_row, m_col;
std::map<int, int> m_rowTable;
TXshChildLevelP m_cl;
bool m_justCreated;
AncestorNode()
: m_xsheet(0), m_row(0), m_col(0), m_rowTable(), m_justCreated(false) {}
};

class DVAPI ChildStack {
class Node;
std::vector<Node *> m_stack;
std::vector<AncestorNode *> m_stack;
TXsheet *m_xsheet;
ToonzScene *m_scene;

Expand Down Expand Up @@ -114,6 +134,8 @@ visible in \b row.
*/
bool getAncestorAffine(TAffine &aff, int row) const;

AncestorNode *getAncestorInfo(int ancestorDepth);

private:
// not implemented
ChildStack(const ChildStack &);
Expand Down
3 changes: 3 additions & 0 deletions toonz/sources/include/toonz/preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,9 @@ class DVAPI Preferences final : public QObject // singleton
bool isShowXSheetToolbarEnabled() const {
return getBoolValue(showXSheetToolbar);
}
bool isShowXsheetBreadcrumbsEnabled() const {
return getBoolValue(showXsheetBreadcrumbs);
}
bool isExpandFunctionHeaderEnabled() const {
return getBoolValue(expandFunctionHeader);
}
Expand Down
1 change: 1 addition & 0 deletions toonz/sources/include/toonz/preferencesitemids.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ enum PreferencesItemId {
inputCellsWithoutDoubleClickingEnabled,
shortcutCommandsWhileRenamingCellEnabled,
showXSheetToolbar,
showXsheetBreadcrumbs,
expandFunctionHeader,
showColumnNumbers,
unifyColumnVisibilityToggles,
Expand Down
4 changes: 4 additions & 0 deletions toonz/sources/toonz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ if(PLATFORM EQUAL 64)
cameracapturelevelcontrol.h
penciltestpopup.h
navtageditorpopup.h
xshbreadcrumbs.h
)
else()
set(MOC_HEADERS
${MOC_HEADERS}
cameracapturelevelcontrol_qt.h
penciltestpopup_qt.h
navtageditorpopup.h
xshbreadcrumbs.h
)
endif()

Expand Down Expand Up @@ -404,13 +406,15 @@ if(PLATFORM EQUAL 64)
cameracapturelevelcontrol.cpp
penciltestpopup.cpp
navtageditorpopup.cpp
xshbreadcrumbs.cpp
)
else()
set(SOURCES
${SOURCES}
cameracapturelevelcontrol_qt.cpp
penciltestpopup_qt.cpp
navtageditorpopup.cpp
xshbreadcrumbs.cpp
)
endif()

Expand Down
58 changes: 58 additions & 0 deletions toonz/sources/toonz/icons/dark/actions/16/toggle_sub_nav.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions toonz/sources/toonz/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2309,6 +2309,9 @@ void MainWindow::defineActions() {
"view_file");
createRightClickMenuAction(MI_ToggleXSheetToolbar,
QT_TR_NOOP("Toggle XSheet Toolbar"), "");
createRightClickMenuAction(MI_ToggleXsheetBreadcrumbs,
QT_TR_NOOP("Toggle Sub-Xsheet Navigation Bar"), "",
"toggle_sub_nav");
createRightClickMenuAction(MI_ToggleXsheetCameraColumn,
QT_TR_NOOP("Show/Hide Xsheet Camera Column"), "");
createRightClickMenuAction(MI_SetKeyframes, QT_TR_NOOP("&Set Key"), "Z",
Expand Down
1 change: 1 addition & 0 deletions toonz/sources/toonz/menubarcommandids.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@
#define MI_UnlockAllColumns "MI_UnlockAllColumns"
#define MI_ToggleColumnLocks "MI_ToggleColumnLocks"
#define MI_ToggleXSheetToolbar "MI_ToggleXSheetToolbar"
#define MI_ToggleXsheetBreadcrumbs "MI_ToggleXsheetBreadcrumbs"
#define MI_FoldColumns "MI_FoldColumns"
#define MI_ToggleXsheetCameraColumn "MI_ToggleXsheetCameraColumn"
#define MI_ToggleCurrentTimeIndicator "MI_ToggleCurrentTimeIndicator"
Expand Down
20 changes: 17 additions & 3 deletions toonz/sources/toonz/preferencespopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,13 @@ void PreferencesPopup::onUnifyColumnVisibilityTogglesChanged() {

//-----------------------------------------------------------------------------

void PreferencesPopup::onShowXsheetBreadcrumbsClicked() {
TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
"XsheetBreadcrumbs");
}

//-----------------------------------------------------------------------------

void PreferencesPopup::onModifyExpressionOnMovingReferencesChanged() {
TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
"modifyExpressionOnMovingReferences");
Expand Down Expand Up @@ -1284,8 +1291,9 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
{shortcutCommandsWhileRenamingCellEnabled,
tr("Enable OpenToonz Commands' Shortcut Keys While Renaming Cell")},
{showXSheetToolbar, tr("Show Toolbar in the Xsheet")},
{showXsheetBreadcrumbs, tr("Show Sub-Xsheet Navigation Bar")},
{expandFunctionHeader,
tr("Expand Function Editor Header to Match Xsheet Toolbar Height*")},
tr("Expand Function Editor Header to Match Xsheet Header Height*")},
{showColumnNumbers, tr("Show Column Numbers in Column Headers")},
{unifyColumnVisibilityToggles,
tr("Unify Preview and Camstand Visibility Toggles")},
Expand Down Expand Up @@ -2024,8 +2032,12 @@ QWidget* PreferencesPopup::createXsheetPage() {
insertUI(useArrowKeyToShiftCellSelection, lay);
insertUI(inputCellsWithoutDoubleClickingEnabled, lay);
insertUI(shortcutCommandsWhileRenamingCellEnabled, lay);
QGridLayout* xshToolbarLay = insertGroupBoxUI(showXSheetToolbar, lay);
{ insertUI(expandFunctionHeader, xshToolbarLay); }
QGridLayout* xshToolbarLay = insertGroupBox(tr("Xsheet Tools"), lay);
{
insertUI(showXSheetToolbar, xshToolbarLay);
insertUI(showXsheetBreadcrumbs, xshToolbarLay);
insertUI(expandFunctionHeader, xshToolbarLay);
}
insertUI(showColumnNumbers, lay);
insertUI(unifyColumnVisibilityToggles, lay);
insertUI(parentColorsInXsheetColumn, lay);
Expand All @@ -2046,6 +2058,8 @@ QWidget* PreferencesPopup::createXsheetPage() {
m_onEditedFuncMap.insert(
unifyColumnVisibilityToggles,
&PreferencesPopup::onUnifyColumnVisibilityTogglesChanged);
m_onEditedFuncMap.insert(showXsheetBreadcrumbs,
&PreferencesPopup::onShowXsheetBreadcrumbsClicked);

QCheckBox* linkColumnNameWithLevelCheck =
getUI<QCheckBox*>(linkColumnNameWithLevel);
Expand Down
1 change: 1 addition & 0 deletions toonz/sources/toonz/preferencespopup.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class PreferencesPopup final : public QDialog {
void onShowKeyframesOnCellAreaChanged();
void onShowXSheetToolbarClicked();
void onUnifyColumnVisibilityTogglesChanged();
void onShowXsheetBreadcrumbsClicked();
// Animation
void onModifyExpressionOnMovingReferencesChanged();
// Preview
Expand Down
2 changes: 2 additions & 0 deletions toonz/sources/toonz/toonz.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@
<file>icons/dark/actions/16/next_nav_tag.svg</file>
<file>icons/dark/actions/16/prev_nav_tag.svg</file>

<file>icons/dark/actions/16/toggle_sub_nav.svg</file>

<!-- Modes, Types, Options -->
<file>icons/dark/actions/16/ink_check.svg</file>
<file>icons/dark/actions/16/inks_only.svg</file>
Expand Down
Loading

0 comments on commit 0999a9e

Please sign in to comment.