Merge pull request #1114 from manongjohn/advanced_preferences_and_options
Show Advanced Preferences and Options
This commit is contained in:
commit
ea4949cca1
9
stuff/profiles/layouts/rooms/OpenToonz/layouts.txt
Normal file
9
stuff/profiles/layouts/rooms/OpenToonz/layouts.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
room1.ini
|
||||
room2.ini
|
||||
room3.ini
|
||||
room4.ini
|
||||
room5.ini
|
||||
room6.ini
|
||||
room7.ini
|
||||
room8.ini
|
||||
room9.ini
|
28
stuff/profiles/layouts/rooms/OpenToonz/room1.ini
Normal file
28
stuff/profiles/layouts/rooms/OpenToonz/room1.ini
Normal file
|
@ -0,0 +1,28 @@
|
|||
[room]
|
||||
pane_0\name=ToolBar
|
||||
pane_0\geometry=@Rect(0 30 34 965)
|
||||
pane_1\name=FilmStrip
|
||||
pane_1\geometry=@Rect(1796 30 124 720)
|
||||
pane_1\vertical=1
|
||||
pane_1\showCombo=1
|
||||
pane_1\navigator=1
|
||||
pane_2\name=ToolOptions
|
||||
pane_2\geometry=@Rect(0 0 1920 26)
|
||||
pane_3\name=LevelPalette
|
||||
pane_3\geometry=@Rect(1452 482 340 268)
|
||||
pane_3\toolbarOnTop=0
|
||||
pane_3\viewtype=0
|
||||
pane_4\name=StyleEditor
|
||||
pane_4\geometry=@Rect(1452 30 340 448)
|
||||
pane_4\isVertical=true
|
||||
pane_4\visibleParts=7
|
||||
pane_4\splitterState=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1]\0\0\0\x62\x1\xff\xff\xff\xff\x1\0\0\0\x2\0)
|
||||
pane_5\name=Timeline
|
||||
pane_5\geometry=@Rect(38 754 1882 241)
|
||||
pane_5\orientation=LeftToRight
|
||||
pane_5\frameZoomFactor=60
|
||||
pane_6\name=SceneViewer
|
||||
pane_6\geometry=@Rect(38 30 1410 720)
|
||||
pane_6\visibleParts=5
|
||||
hierarchy="-1 1 [ 2 [ 0 [ [ 6 [ 4 3 ] 1 ] 5 ] ] ] "
|
||||
name=Drawing
|
16
stuff/profiles/layouts/rooms/OpenToonz/room2.ini
Normal file
16
stuff/profiles/layouts/rooms/OpenToonz/room2.ini
Normal file
|
@ -0,0 +1,16 @@
|
|||
[room]
|
||||
pane_0\name=CleanupSettings
|
||||
pane_0\geometry=@Rect(987 30 293 668)
|
||||
pane_1\name=ToolOptions
|
||||
pane_1\geometry=@Rect(0 0 1280 26)
|
||||
pane_2\name=SceneViewer
|
||||
pane_2\geometry=@Rect(38 30 945 445)
|
||||
pane_2\visibleParts=5
|
||||
pane_3\name=ToolBar
|
||||
pane_3\geometry=@Rect(0 30 34 668)
|
||||
pane_4\name=Xsheet
|
||||
pane_4\geometry=@Rect(38 479 945 219)
|
||||
pane_4\orientation=TopToBottom
|
||||
pane_4\frameZoomFactor=100
|
||||
hierarchy="-1 1 [ 1 [ 3 [ 2 4 ] 0 ] ] "
|
||||
name=Cleanup
|
27
stuff/profiles/layouts/rooms/OpenToonz/room3.ini
Normal file
27
stuff/profiles/layouts/rooms/OpenToonz/room3.ini
Normal file
|
@ -0,0 +1,27 @@
|
|||
[room]
|
||||
pane_0\name=ToolBar
|
||||
pane_0\geometry=@Rect(0 30 34 965)
|
||||
pane_1\name=ToolOptions
|
||||
pane_1\geometry=@Rect(0 0 1920 26)
|
||||
pane_2\name=Xsheet
|
||||
pane_2\geometry=@Rect(547 628 948 367)
|
||||
pane_2\orientation=TopToBottom
|
||||
pane_2\frameZoomFactor=100
|
||||
pane_3\name=LevelPalette
|
||||
pane_3\geometry=@Rect(38 628 505 367)
|
||||
pane_3\toolbarOnTop=0
|
||||
pane_3\viewtype=2
|
||||
pane_4\name=StyleEditor
|
||||
pane_4\geometry=@Rect(38 30 312 594)
|
||||
pane_4\isVertical=true
|
||||
pane_4\visibleParts=15
|
||||
pane_4\splitterState=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\0\xf4\0\0\0\xf5\x1\xff\xff\xff\xff\x1\0\0\0\x2\0)
|
||||
pane_5\name=StudioPalette
|
||||
pane_5\geometry=@Rect(1499 628 421 367)
|
||||
pane_5\toolbarOnTop=0
|
||||
pane_5\viewtype=1
|
||||
pane_6\name=SceneViewer
|
||||
pane_6\geometry=@Rect(354 30 1566 594)
|
||||
pane_6\visibleParts=5
|
||||
hierarchy="-1 1 [ 1 [ 0 [ [ 4 6 ] [ 3 2 5 ] ] ] ] "
|
||||
name=Palette
|
21
stuff/profiles/layouts/rooms/OpenToonz/room4.ini
Normal file
21
stuff/profiles/layouts/rooms/OpenToonz/room4.ini
Normal file
|
@ -0,0 +1,21 @@
|
|||
[room]
|
||||
pane_0\name=FilmStrip
|
||||
pane_0\geometry=@Rect(1797 30 123 965)
|
||||
pane_0\vertical=1
|
||||
pane_0\showCombo=1
|
||||
pane_0\navigator=1
|
||||
pane_1\name=LevelPalette
|
||||
pane_1\geometry=@Rect(1489 619 304 376)
|
||||
pane_1\toolbarOnTop=0
|
||||
pane_1\viewtype=1
|
||||
pane_2\name=ToolBar
|
||||
pane_2\geometry=@Rect(0 30 34 965)
|
||||
pane_3\name=ToolOptions
|
||||
pane_3\geometry=@Rect(0 0 1920 26)
|
||||
pane_4\name=ColorModel
|
||||
pane_4\geometry=@Rect(1489 30 304 585)
|
||||
pane_5\name=SceneViewer
|
||||
pane_5\geometry=@Rect(38 30 1447 965)
|
||||
pane_5\visibleParts=5
|
||||
hierarchy="-1 1 [ 3 [ 2 5 [ 4 1 ] 0 ] ] "
|
||||
name=InknPaint
|
27
stuff/profiles/layouts/rooms/OpenToonz/room5.ini
Normal file
27
stuff/profiles/layouts/rooms/OpenToonz/room5.ini
Normal file
|
@ -0,0 +1,27 @@
|
|||
[room]
|
||||
pane_0\name=Xsheet
|
||||
pane_0\geometry=@Rect(1121 30 681 551)
|
||||
pane_0\orientation=TopToBottom
|
||||
pane_0\frameZoomFactor=100
|
||||
pane_1\name=ToolBar
|
||||
pane_1\geometry=@Rect(0 30 34 965)
|
||||
pane_2\name=ToolOptions
|
||||
pane_2\geometry=@Rect(0 0 1920 26)
|
||||
pane_3\name=Schematic
|
||||
pane_3\geometry=@Rect(1121 585 799 410)
|
||||
pane_3\viewtype=1
|
||||
pane_4\name=FunctionEditor
|
||||
pane_4\geometry=@Rect(38 584 1079 411)
|
||||
pane_4\toggleStatus=0
|
||||
pane_4\showIbtwnValuesInSheet=true
|
||||
pane_4\syncSize=true
|
||||
pane_5\name=FilmStrip
|
||||
pane_5\geometry=@Rect(1806 30 114 551)
|
||||
pane_5\vertical=1
|
||||
pane_5\showCombo=1
|
||||
pane_5\navigator=1
|
||||
pane_6\name=SceneViewer
|
||||
pane_6\geometry=@Rect(38 30 1079 550)
|
||||
pane_6\visibleParts=5
|
||||
hierarchy="-1 1 [ 2 [ 1 [ 6 4 ] [ [ 0 5 ] 3 ] ] ] "
|
||||
name=Animation
|
18
stuff/profiles/layouts/rooms/OpenToonz/room6.ini
Normal file
18
stuff/profiles/layouts/rooms/OpenToonz/room6.ini
Normal file
|
@ -0,0 +1,18 @@
|
|||
[room]
|
||||
pane_0\name=ToolOptions
|
||||
pane_0\geometry=@Rect(0 0 1920 26)
|
||||
pane_1\name=FunctionEditor
|
||||
pane_1\geometry=@Rect(1180 30 740 965)
|
||||
pane_1\toggleStatus=0
|
||||
pane_1\showIbtwnValuesInSheet=true
|
||||
pane_1\syncSize=true
|
||||
pane_2\name=Schematic
|
||||
pane_2\geometry=@Rect(38 496 1138 499)
|
||||
pane_2\viewtype=0
|
||||
pane_3\name=ToolBar
|
||||
pane_3\geometry=@Rect(0 30 34 965)
|
||||
pane_4\name=SceneViewer
|
||||
pane_4\geometry=@Rect(38 30 1138 462)
|
||||
pane_4\visibleParts=5
|
||||
hierarchy="-1 1 [ 0 [ 3 [ 4 2 ] 1 ] ] "
|
||||
name=Schematic
|
15
stuff/profiles/layouts/rooms/OpenToonz/room7.ini
Normal file
15
stuff/profiles/layouts/rooms/OpenToonz/room7.ini
Normal file
|
@ -0,0 +1,15 @@
|
|||
[room]
|
||||
pane_0\name=Xsheet
|
||||
pane_0\geometry=@Rect(0 0 1050 995)
|
||||
pane_0\orientation=TopToBottom
|
||||
pane_0\frameZoomFactor=100
|
||||
pane_1\name=FunctionEditor
|
||||
pane_1\geometry=@Rect(1054 494 866 501)
|
||||
pane_1\toggleStatus=0
|
||||
pane_1\showIbtwnValuesInSheet=true
|
||||
pane_1\syncSize=true
|
||||
pane_2\name=SceneViewer
|
||||
pane_2\geometry=@Rect(1054 0 866 490)
|
||||
pane_2\visibleParts=5
|
||||
hierarchy="-1 0 [ 0 [ 2 1 ] ] "
|
||||
name=Xsheet
|
5
stuff/profiles/layouts/rooms/OpenToonz/room8.ini
Normal file
5
stuff/profiles/layouts/rooms/OpenToonz/room8.ini
Normal file
|
@ -0,0 +1,5 @@
|
|||
[room]
|
||||
pane_0\name=Tasks
|
||||
pane_0\geometry=@Rect(0 0 1920 995)
|
||||
hierarchy="-1 0 0 "
|
||||
name=Tasks
|
7
stuff/profiles/layouts/rooms/OpenToonz/room9.ini
Normal file
7
stuff/profiles/layouts/rooms/OpenToonz/room9.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[room]
|
||||
pane_0\name=Browser
|
||||
pane_0\geometry=@Rect(0 0 1920 505)
|
||||
pane_1\name=SceneCast
|
||||
pane_1\geometry=@Rect(0 509 1920 486)
|
||||
hierarchy="-1 1 [ 0 1 ] "
|
||||
name=Browser
|
6
stuff/profiles/layouts/rooms/StudioGhibli/layouts.txt
Normal file
6
stuff/profiles/layouts/rooms/StudioGhibli/layouts.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
room1.ini
|
||||
room2.ini
|
||||
room3.ini
|
||||
room4.ini
|
||||
room5.ini
|
||||
room6.ini
|
9
stuff/profiles/layouts/rooms/StudioGhibli/room1.ini
Normal file
9
stuff/profiles/layouts/rooms/StudioGhibli/room1.ini
Normal file
|
@ -0,0 +1,9 @@
|
|||
[room]
|
||||
pane_0\name=ComboViewer
|
||||
pane_0\geometry=@Rect(0 0 851 452)
|
||||
pane_1\name=CleanupSettings
|
||||
pane_1\geometry=@Rect(859 0 251 611)
|
||||
pane_2\name=Xsheet
|
||||
pane_2\geometry=@Rect(0 460 851 151)
|
||||
hierarchy="-1 0 [ [ 0 2 ] 1 ] "
|
||||
name=Cleanup
|
14
stuff/profiles/layouts/rooms/StudioGhibli/room2.ini
Normal file
14
stuff/profiles/layouts/rooms/StudioGhibli/room2.ini
Normal file
|
@ -0,0 +1,14 @@
|
|||
[room]
|
||||
pane_0\name=ComboViewer
|
||||
pane_0\geometry=@Rect(0 0 700 600)
|
||||
pane_1\name=LevelPalette
|
||||
pane_1\geometry=@Rect(0 0 100 50)
|
||||
pane_1\viewtype=2
|
||||
pane_2\name=StyleEditor
|
||||
pane_2\geometry=@Rect(0 0 340 630)
|
||||
pane_3\name=Xsheet
|
||||
pane_3\geometry=@Rect(0 0 500 300)
|
||||
pane_4\name=StudioPalette
|
||||
pane_4\geometry=@Rect(0 0 100 50)
|
||||
hierarchy="-1 1 [ [ 2 0 ] [ 4 3 1 ] ] "
|
||||
name=PltEdit
|
10
stuff/profiles/layouts/rooms/StudioGhibli/room3.ini
Normal file
10
stuff/profiles/layouts/rooms/StudioGhibli/room3.ini
Normal file
|
@ -0,0 +1,10 @@
|
|||
[room]
|
||||
pane_0\name=ComboViewer
|
||||
pane_0\geometry=@Rect(0 0 700 600)
|
||||
pane_1\name=LevelPalette
|
||||
pane_1\geometry=@Rect(0 0 100 50)
|
||||
pane_1\viewtype=2
|
||||
pane_2\name=FilmStrip
|
||||
pane_2\geometry=@Rect(0 0 201 50)
|
||||
hierarchy="-1 1 [ [ 0 2 ] 1 ] "
|
||||
name=InknPaint
|
7
stuff/profiles/layouts/rooms/StudioGhibli/room4.ini
Normal file
7
stuff/profiles/layouts/rooms/StudioGhibli/room4.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[room]
|
||||
pane_0\name=Xsheet
|
||||
pane_0\geometry=@Rect(0 0 500 300)
|
||||
pane_1\name=FunctionEditor
|
||||
pane_1\geometry=@Rect(0 0 100 50)
|
||||
hierarchy="-1 0 [ 0 1 ] "
|
||||
name=Xsheet
|
7
stuff/profiles/layouts/rooms/StudioGhibli/room5.ini
Normal file
7
stuff/profiles/layouts/rooms/StudioGhibli/room5.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[room]
|
||||
pane_0\name=Tasks
|
||||
pane_0\geometry=@Rect(0 0 100 50)
|
||||
pane_1\name=BatchServers
|
||||
pane_1\geometry=@Rect(0 0 100 50)
|
||||
hierarchy="-1 0 [ 0 1 ] "
|
||||
name=Batches
|
7
stuff/profiles/layouts/rooms/StudioGhibli/room6.ini
Normal file
7
stuff/profiles/layouts/rooms/StudioGhibli/room6.ini
Normal file
|
@ -0,0 +1,7 @@
|
|||
[room]
|
||||
pane_0\name=Browser
|
||||
pane_0\geometry=@Rect(0 0 100 50)
|
||||
pane_1\name=SceneCast
|
||||
pane_1\geometry=@Rect(0 0 100 50)
|
||||
hierarchy="-1 1 [ 0 1 ] "
|
||||
name=Browser
|
|
@ -192,6 +192,10 @@ public:
|
|||
return PathAliasPriority(getIntValue(pathAliasPriority));
|
||||
}
|
||||
|
||||
bool isShowAdvancedOptionsEnabled() const {
|
||||
return getBoolValue(showAdvancedOptions);
|
||||
}
|
||||
|
||||
// Interface tab
|
||||
QStringList getStyleSheetList() const { return m_styleSheetList; }
|
||||
bool getIconTheme() const { return getBoolValue(iconTheme); }
|
||||
|
|
|
@ -20,6 +20,7 @@ enum PreferencesItemId {
|
|||
projectRoot,
|
||||
customProjectRoot,
|
||||
pathAliasPriority,
|
||||
showAdvancedOptions,
|
||||
|
||||
//----------
|
||||
// Interface
|
||||
|
|
|
@ -88,6 +88,7 @@ class DVAPI CameraSettingsWidget final : public QFrame {
|
|||
QLabel *m_resLabel;
|
||||
QLabel *m_xLabel;
|
||||
QLabel *m_unitLabel;
|
||||
QLabel *m_arLabel;
|
||||
|
||||
QPushButton *m_fspChk; // Force Squared Pixel => dpix == dpiy
|
||||
|
||||
|
|
|
@ -802,7 +802,6 @@ class DVAPI StyleEditor final : public QWidget, public SaveLoadQSettings {
|
|||
*m_newColor; //!< New style viewer (lower-right panel side).
|
||||
DVGui::StyleSample
|
||||
*m_oldColor; //!< Old style viewer (lower-right panel side).
|
||||
QFrame *m_fillColorWidget;
|
||||
QAction *m_toggleOrientationAction;
|
||||
QPushButton
|
||||
*m_autoButton; //!< "Auto Apply" checkbox on the right panel side.
|
||||
|
@ -867,6 +866,10 @@ class DVAPI StyleEditor final : public QWidget, public SaveLoadQSettings {
|
|||
|
||||
RenameStyleSet *m_renameStyleSet;
|
||||
|
||||
QWidget *m_autoApplyWidget;
|
||||
QAction *m_toggleAutoApply;
|
||||
bool m_showAutoApply = true;
|
||||
|
||||
public:
|
||||
StyleEditor(PaletteController *, QWidget *parent = 0);
|
||||
~StyleEditor();
|
||||
|
@ -1004,6 +1007,7 @@ protected slots:
|
|||
void onHexEdited(const QString &text);
|
||||
void onHideMenu();
|
||||
void onPageChanged(int index);
|
||||
void onToggleAutoApply();
|
||||
|
||||
void onToggleTextureSet(int checkedState);
|
||||
void onToggleVectorSet(int checkedState);
|
||||
|
|
|
@ -742,15 +742,16 @@ void FullColorBrushTool::mouseMove(const TPointD &pos, const TMouseEvent &e) {
|
|||
|
||||
// locals.addMinMax(m_thickness, int(add));
|
||||
//} else
|
||||
// if (e.isCtrlPressed() && e.isAltPressed()) {
|
||||
// const TPointD &diff = pos - m_mousePos;
|
||||
// double max = diff.x / 2;
|
||||
// double min = diff.y / 2;
|
||||
if (e.isCtrlPressed() && e.isAltPressed() && !e.isShiftPressed() &&
|
||||
Preferences::instance()->useCtrlAltToResizeBrushEnabled()) {
|
||||
const TPointD &diff = pos - m_mousePos;
|
||||
double max = diff.x / 2;
|
||||
double min = diff.y / 2;
|
||||
|
||||
// locals.addMinMaxSeparate(m_thickness, int(min), int(max));
|
||||
//} else {
|
||||
m_brushPos = pos;
|
||||
//}
|
||||
locals.addMinMaxSeparate(m_thickness, int(min), int(max));
|
||||
} else {
|
||||
m_brushPos = pos;
|
||||
}
|
||||
|
||||
m_mousePos = pos;
|
||||
|
||||
|
|
|
@ -2179,25 +2179,25 @@ void ToonzRasterBrushTool::mouseMove(const TPointD &pos, const TMouseEvent &e) {
|
|||
TPointD halfThick(thickness * 0.5, thickness * 0.5);
|
||||
TRectD invalidateRect(m_brushPos - halfThick, m_brushPos + halfThick);
|
||||
|
||||
// if (e.isCtrlPressed() && e.isAltPressed() && !e.isShiftPressed() &&
|
||||
// Preferences::instance()->useCtrlAltToResizeBrushEnabled()) {
|
||||
// // Resize the brush if CTRL+ALT is pressed and the preference is enabled.
|
||||
// const TPointD &diff = pos - m_mousePos;
|
||||
// double max = diff.x / 2;
|
||||
// double min = diff.y / 2;
|
||||
if (e.isCtrlPressed() && e.isAltPressed() && !e.isShiftPressed() &&
|
||||
Preferences::instance()->useCtrlAltToResizeBrushEnabled()) {
|
||||
// Resize the brush if CTRL+ALT is pressed and the preference is enabled.
|
||||
const TPointD &diff = pos - m_mousePos;
|
||||
double max = diff.x / 2;
|
||||
double min = diff.y / 2;
|
||||
|
||||
// locals.addMinMaxSeparate(m_rasThickness, min, max);
|
||||
locals.addMinMaxSeparate(m_rasThickness, min, max);
|
||||
|
||||
// double radius = m_rasThickness.getValue().second * 0.5;
|
||||
// invalidateRect += TRectD(m_brushPos - TPointD(radius, radius),
|
||||
// m_brushPos + TPointD(radius, radius));
|
||||
double radius = m_rasThickness.getValue().second * 0.5;
|
||||
invalidateRect += TRectD(m_brushPos - TPointD(radius, radius),
|
||||
m_brushPos + TPointD(radius, radius));
|
||||
|
||||
//} else {
|
||||
m_mousePos = pos;
|
||||
m_brushPos = getCenteredCursorPos(pos);
|
||||
} else {
|
||||
m_mousePos = pos;
|
||||
m_brushPos = getCenteredCursorPos(pos);
|
||||
|
||||
invalidateRect += TRectD(pos - halfThick, pos + halfThick);
|
||||
//}
|
||||
invalidateRect += TRectD(pos - halfThick, pos + halfThick);
|
||||
}
|
||||
|
||||
invalidate(invalidateRect.enlarge(2));
|
||||
|
||||
|
|
|
@ -1571,42 +1571,42 @@ void ToonzVectorBrushTool::mouseMove(const TPointD &pos, const TMouseEvent &e) {
|
|||
TPointD halfThick(m_maxThick * 0.5, m_maxThick * 0.5);
|
||||
TRectD invalidateRect(m_brushPos - halfThick, m_brushPos + halfThick);
|
||||
|
||||
// if (e.isCtrlPressed() && e.isAltPressed() && !e.isShiftPressed() &&
|
||||
// Preferences::instance()->useCtrlAltToResizeBrushEnabled()) {
|
||||
// // Resize the brush if CTRL+ALT is pressed and the preference is enabled.
|
||||
// const TPointD &diff = pos - m_mousePos;
|
||||
// double max = diff.x / 2;
|
||||
// double min = diff.y / 2;
|
||||
if (e.isCtrlPressed() && e.isAltPressed() && !e.isShiftPressed() &&
|
||||
Preferences::instance()->useCtrlAltToResizeBrushEnabled()) {
|
||||
// Resize the brush if CTRL+ALT is pressed and the preference is enabled.
|
||||
const TPointD &diff = pos - m_mousePos;
|
||||
double max = diff.x / 2;
|
||||
double min = diff.y / 2;
|
||||
|
||||
// locals.addMinMaxSeparate(m_thickness, min, max);
|
||||
locals.addMinMaxSeparate(m_thickness, min, max);
|
||||
|
||||
// double radius = m_thickness.getValue().second * 0.5;
|
||||
// invalidateRect += TRectD(m_brushPos - TPointD(radius, radius),
|
||||
// m_brushPos + TPointD(radius, radius));
|
||||
double radius = m_thickness.getValue().second * 0.5;
|
||||
invalidateRect += TRectD(m_brushPos - TPointD(radius, radius),
|
||||
m_brushPos + TPointD(radius, radius));
|
||||
|
||||
//} else {
|
||||
m_mousePos = pos;
|
||||
m_brushPos = pos;
|
||||
} else {
|
||||
m_mousePos = pos;
|
||||
m_brushPos = pos;
|
||||
|
||||
TPointD snapThick(6.0 * m_pixelSize, 6.0 * m_pixelSize);
|
||||
// In order to clear the previous snap indicator
|
||||
if (m_foundFirstSnap)
|
||||
invalidateRect +=
|
||||
TRectD(m_firstSnapPoint - snapThick, m_firstSnapPoint + snapThick);
|
||||
TPointD snapThick(6.0 * m_pixelSize, 6.0 * m_pixelSize);
|
||||
// In order to clear the previous snap indicator
|
||||
if (m_foundFirstSnap)
|
||||
invalidateRect +=
|
||||
TRectD(m_firstSnapPoint - snapThick, m_firstSnapPoint + snapThick);
|
||||
|
||||
m_firstSnapPoint = pos;
|
||||
m_foundFirstSnap = false;
|
||||
m_toggleSnap = !e.isAltPressed() && e.isCtrlPressed() && e.isShiftPressed();
|
||||
checkStrokeSnapping(true, m_toggleSnap);
|
||||
checkGuideSnapping(true, m_toggleSnap);
|
||||
m_brushPos = m_firstSnapPoint;
|
||||
// In order to draw the snap indicator
|
||||
if (m_foundFirstSnap)
|
||||
invalidateRect +=
|
||||
TRectD(m_firstSnapPoint - snapThick, m_firstSnapPoint + snapThick);
|
||||
m_firstSnapPoint = pos;
|
||||
m_foundFirstSnap = false;
|
||||
m_toggleSnap = !e.isAltPressed() && e.isCtrlPressed() && e.isShiftPressed();
|
||||
checkStrokeSnapping(true, m_toggleSnap);
|
||||
checkGuideSnapping(true, m_toggleSnap);
|
||||
m_brushPos = m_firstSnapPoint;
|
||||
// In order to draw the snap indicator
|
||||
if (m_foundFirstSnap)
|
||||
invalidateRect +=
|
||||
TRectD(m_firstSnapPoint - snapThick, m_firstSnapPoint + snapThick);
|
||||
|
||||
invalidateRect += TRectD(pos - halfThick, pos + halfThick);
|
||||
//}
|
||||
invalidateRect += TRectD(pos - halfThick, pos + halfThick);
|
||||
}
|
||||
|
||||
invalidate(invalidateRect.enlarge(2));
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
// TnzLib includes
|
||||
#include "toonz/txshlevelhandle.h"
|
||||
#include "toonz/levelproperties.h"
|
||||
#include "toonz/preferences.h"
|
||||
|
||||
// TnzBase includes
|
||||
#include "tunit.h"
|
||||
|
@ -539,17 +540,19 @@ CanvasSizePopup::CanvasSizePopup()
|
|||
|
||||
addSeparator(tr("New Size"));
|
||||
|
||||
//// Unit
|
||||
//m_unit = new QComboBox(this);
|
||||
//m_unit->addItem(tr("pixel"), "pixel");
|
||||
//m_unit->addItem(tr("mm"), "mm");
|
||||
//m_unit->addItem(tr("cm"), "cm");
|
||||
//m_unit->addItem(tr("field"), "field");
|
||||
//m_unit->addItem(tr("inch"), "inch");
|
||||
//m_unit->setFixedHeight(DVGui::WidgetHeight);
|
||||
//addWidget(tr("Unit:"), m_unit);
|
||||
//connect(m_unit, SIGNAL(currentIndexChanged(int)), this,
|
||||
// SLOT(onUnitChanged(int)));
|
||||
// Unit
|
||||
m_unit = new QComboBox(this);
|
||||
m_unit->addItem(tr("pixel"), "pixel");
|
||||
m_unit->addItem(tr("mm"), "mm");
|
||||
m_unit->addItem(tr("cm"), "cm");
|
||||
m_unit->addItem(tr("field"), "field");
|
||||
m_unit->addItem(tr("inch"), "inch");
|
||||
m_unit->setFixedHeight(DVGui::WidgetHeight);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled()) {
|
||||
addWidget(tr("Unit:"), m_unit);
|
||||
connect(m_unit, SIGNAL(currentIndexChanged(int)), this,
|
||||
SLOT(onUnitChanged(int)));
|
||||
}
|
||||
|
||||
// New Xsize
|
||||
m_xSizeFld = new DVGui::DoubleLineEdit(this, dim.lx);
|
||||
|
|
|
@ -73,7 +73,7 @@ class CanvasSizePopup final : public DVGui::Dialog {
|
|||
|
||||
QLabel *m_currentXSize;
|
||||
QLabel *m_currentYSize;
|
||||
//QComboBox *m_unit;
|
||||
QComboBox *m_unit;
|
||||
DVGui::DoubleLineEdit *m_xSizeFld;
|
||||
DVGui::DoubleLineEdit *m_ySizeFld;
|
||||
DVGui::CheckBox *m_relative;
|
||||
|
|
|
@ -321,7 +321,11 @@ LevelSettingsPopup::LevelSettingsPopup()
|
|||
, m_whiteTransp(0)
|
||||
, m_scanPathFld(0) {
|
||||
setWindowTitle(tr("Level Settings"));
|
||||
m_mainFrame->setFixedHeight(280);
|
||||
|
||||
bool showAdvancedOptions =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled();
|
||||
|
||||
m_mainFrame->setFixedHeight(showAdvancedOptions ? 420 : 280);
|
||||
m_mainFrame->setFixedWidth(380);
|
||||
this->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
|
||||
|
@ -482,7 +486,9 @@ LevelSettingsPopup::LevelSettingsPopup()
|
|||
dpiLayout->addWidget(imageDpiTitle, 5, 0,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
dpiLayout->addWidget(m_imageDpiLabel, 5, 1, 1, 3);
|
||||
|
||||
dpiLayout->addWidget(imageResTitle, 6, 0,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
dpiLayout->addWidget(m_imageResLabel, 6, 1, 1, 3);
|
||||
}
|
||||
dpiLayout->setColumnStretch(0, 0);
|
||||
dpiLayout->setColumnStretch(1, 1);
|
||||
|
@ -491,13 +497,15 @@ LevelSettingsPopup::LevelSettingsPopup()
|
|||
dpiBox->setLayout(dpiLayout);
|
||||
|
||||
m_topLayout->addWidget(dpiBox);
|
||||
dpiBox->hide();
|
||||
if (!showAdvancedOptions) {
|
||||
dpiBox->hide();
|
||||
|
||||
QHBoxLayout* resLayout = new QHBoxLayout();
|
||||
resLayout->addWidget(imageResTitle);
|
||||
resLayout->addWidget(m_imageResLabel);
|
||||
resLayout->addStretch();
|
||||
m_topLayout->addLayout(resLayout);
|
||||
QHBoxLayout *resLayout = new QHBoxLayout();
|
||||
resLayout->addWidget(imageResTitle);
|
||||
resLayout->addWidget(m_imageResLabel);
|
||||
resLayout->addStretch();
|
||||
m_topLayout->addLayout(resLayout);
|
||||
}
|
||||
|
||||
m_topLayout->addWidget(m_doPremultiply);
|
||||
|
||||
|
|
|
@ -454,7 +454,7 @@ int main(int argc, char *argv[]) {
|
|||
// qDebug() << "All icon theme search paths:" << QIcon::themeSearchPaths();
|
||||
|
||||
// Set show icons in menus flag (use iconVisibleInMenu to disable selectively)
|
||||
QApplication::instance()->setAttribute(Qt::AA_DontShowIconsInMenus, true);
|
||||
QApplication::instance()->setAttribute(Qt::AA_DontShowIconsInMenus, false);
|
||||
|
||||
TEnv::setApplicationFileName(argv[0]);
|
||||
|
||||
|
|
|
@ -1413,7 +1413,8 @@ QAction *MainWindow::createAction(const char *id, const char *name,
|
|||
QAction *action = new DVAction(tr(name), this);
|
||||
|
||||
#if !defined(_WIN32)
|
||||
bool visible = false; //Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
bool visible = Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
action->setIconVisibleInMenu(visible);
|
||||
#endif
|
||||
|
||||
|
@ -1678,7 +1679,8 @@ QAction *MainWindow::createToggle(const char *id, const char *name,
|
|||
if (!iconSVGName || !*iconSVGName) action->setIcon(QIcon());
|
||||
#if defined(_WIN32)
|
||||
else {
|
||||
bool visible = false; //Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
bool visible = Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
action->setIconVisibleInMenu(visible);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -483,6 +483,18 @@ void PreferencesPopup::onWatchFileSystemClicked() {
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void PreferencesPopup::onShowAdvancedOptionsChanged() {
|
||||
CheckBox* showAdvancedOptionsCB = getUI<CheckBox*>(showAdvancedOptions);
|
||||
if (!showAdvancedOptionsCB->isChecked()) {
|
||||
m_pref->setValue(pixelsOnly, true);
|
||||
m_pref->setValue(linearUnits, "pixel");
|
||||
m_pref->setValue(cameraUnits, "pixel");
|
||||
m_pref->setValue(DefLevelDpi, Stage::standardDpi);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void PreferencesPopup::onPathAliasPriorityChanged() {
|
||||
TApp::instance()->getCurrentScene()->notifyPreferenceChanged(
|
||||
"PathAliasPriority");
|
||||
|
@ -583,7 +595,7 @@ void PreferencesPopup::onPixelsOnlyChanged() {
|
|||
unitOm->setDisabled(false);
|
||||
cameraUnitOm->setDisabled(false);
|
||||
bool isRaster = m_pref->getIntValue(DefLevelType) != PLI_XSHLEVEL;
|
||||
if (isRaster) {
|
||||
if (isRaster && !m_pref->getBoolValue(newLevelSizeToCameraSizeEnabled)) {
|
||||
defLevelDpi->setDisabled(false);
|
||||
}
|
||||
defLevelHeight->setMeasure("level.ly");
|
||||
|
@ -604,6 +616,11 @@ void PreferencesPopup::onUnitChanged() {
|
|||
(m_pref->getStringValue(linearUnits) == "pixel" ||
|
||||
m_pref->getStringValue(cameraUnits) == "pixel")) {
|
||||
pixelsOnlyCB->setCheckState(Qt::Checked);
|
||||
} else if (pixelsOnlyCB->isChecked() &&
|
||||
(m_pref->getStringValue(linearUnits) != "pixel" &&
|
||||
m_pref->getStringValue(cameraUnits) != "pixel")) {
|
||||
m_pref->setPixelsOnly();
|
||||
pixelsOnlyCB->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -628,8 +645,9 @@ void PreferencesPopup::onDefLevelTypeChanged() {
|
|||
!m_pref->getBoolValue(newLevelSizeToCameraSizeEnabled);
|
||||
m_controlIdMap.key(DefLevelWidth)->setEnabled(isRaster);
|
||||
m_controlIdMap.key(DefLevelHeight)->setEnabled(isRaster);
|
||||
// if (!m_pref->getBoolValue(pixelsOnly))
|
||||
// m_controlIdMap.key(DefLevelDpi)->setEnabled(isRaster);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
!m_pref->getBoolValue(pixelsOnly))
|
||||
m_controlIdMap.key(DefLevelDpi)->setEnabled(isRaster);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1182,10 +1200,11 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
|
|||
//{ projectRoot, tr("") },
|
||||
{customProjectRoot, tr("Custom Project Path(s):")},
|
||||
{pathAliasPriority, tr("Path Alias Priority:")},
|
||||
{showAdvancedOptions, tr("Show Advanced Preferences and Options*")},
|
||||
|
||||
// Interface
|
||||
{CurrentStyleSheetName, tr("Theme:")},
|
||||
//{iconTheme, tr("Switch to dark icons")},
|
||||
{iconTheme, tr("Switch to dark icons")},
|
||||
{pixelsOnly, tr("All imported images will use the same DPI")},
|
||||
//{ oldUnits, tr("") },
|
||||
//{ oldCameraUnits, tr("") },
|
||||
|
@ -1277,7 +1296,7 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
|
|||
|
||||
// Tools
|
||||
// {dropdownShortcutsCycleOptions, tr("Dropdown Shortcuts:")}, // removed
|
||||
// {FillOnlysavebox, tr("Use the TLV Savebox to Limit Filling Operations")}, // Moved to tools that need it
|
||||
{FillOnlysavebox, tr("Use the TLV Savebox to Limit Filling Operations")}, // Moved to tools that need it
|
||||
{multiLayerStylePickerEnabled,
|
||||
tr("Multi Layer Style Picker: Switch Levels by Picking")},
|
||||
{cursorBrushType, tr("Basic Cursor Type:")},
|
||||
|
@ -1320,7 +1339,7 @@ QString PreferencesPopup::getUIString(PreferencesItemId id) {
|
|||
//},
|
||||
{levelNameDisplayType, tr("Level Name Display:")},
|
||||
{showFrameNumberWithLetters,
|
||||
tr("Show \"ABC\" Appendix to the Frame Number in Xsheet Cell")},
|
||||
tr("Show \"ABC\" Appendix to the Frame Number in Scene Cell")},
|
||||
|
||||
// Animation
|
||||
{keyframeType, tr("Default Interpolation:")},
|
||||
|
@ -1590,6 +1609,8 @@ QWidget* PreferencesPopup::createGeneralPage() {
|
|||
|
||||
insertUI(pathAliasPriority, lay, getComboItemList(pathAliasPriority));
|
||||
|
||||
insertUI(showAdvancedOptions, lay);
|
||||
|
||||
lay->setRowStretch(lay->rowCount(), 1);
|
||||
insertFootNote(lay);
|
||||
widget->setLayout(lay);
|
||||
|
@ -1623,6 +1644,8 @@ QWidget* PreferencesPopup::createGeneralPage() {
|
|||
&PreferencesPopup::onAutoSaveOptionsChanged);
|
||||
m_onEditedFuncMap.insert(watchFileSystemEnabled,
|
||||
&PreferencesPopup::onWatchFileSystemClicked);
|
||||
m_onEditedFuncMap.insert(showAdvancedOptions,
|
||||
&PreferencesPopup::onShowAdvancedOptionsChanged);
|
||||
|
||||
bool ret = true;
|
||||
ret = ret && connect(m_pref, SIGNAL(stopAutoSave()), this,
|
||||
|
@ -1681,15 +1704,18 @@ QWidget* PreferencesPopup::createInterfacePage() {
|
|||
// Qt::AlignRight | Qt::AlignVCenter);
|
||||
// lay->addWidget(createUI(iconTheme), 2, 1);
|
||||
|
||||
// insertUI(linearUnits, lay, getComboItemList(linearUnits));
|
||||
// insertUI(cameraUnits, lay,
|
||||
// getComboItemList(linearUnits)); // share items with linearUnits
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled()) {
|
||||
insertUI(linearUnits, lay, getComboItemList(linearUnits));
|
||||
insertUI(cameraUnits, lay,
|
||||
getComboItemList(linearUnits)); // share items with linearUnits
|
||||
|
||||
// lay->addWidget(new QLabel(tr("Pixels Only:"), this), 5, 0,
|
||||
// Qt::AlignRight | Qt::AlignVCenter);
|
||||
// lay->addWidget(createUI(pixelsOnly), 5, 1, 1, 2, Qt::AlignLeft);
|
||||
lay->addWidget(new QLabel(tr("Pixels Only:"), this), 5, 0,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
lay->addWidget(createUI(pixelsOnly), 5, 1, 1, 2, Qt::AlignLeft);
|
||||
|
||||
insertUI(CurrentRoomChoice, lay, roomItemList);
|
||||
}
|
||||
|
||||
// insertUI(CurrentRoomChoice, lay, roomItemList);
|
||||
insertUI(functionEditorToggle, lay, getComboItemList(functionEditorToggle));
|
||||
insertUI(moveCurrentFrameByClickCellArea, lay);
|
||||
insertUI(actualPixelViewOnSceneEditingMode, lay);
|
||||
|
@ -1697,12 +1723,16 @@ QWidget* PreferencesPopup::createInterfacePage() {
|
|||
insertUI(showRasterImagesDarkenBlendedInViewer, lay);
|
||||
insertUI(iconSize, lay);
|
||||
insertDualUIs(viewShrink, viewStep, lay);
|
||||
// insertUI(viewerZoomCenter, lay, getComboItemList(viewerZoomCenter));
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(viewerZoomCenter, lay, getComboItemList(viewerZoomCenter));
|
||||
insertUI(CurrentLanguageName, lay, languageItemList);
|
||||
// insertUI(interfaceFont, lay); // creates QFontComboBox
|
||||
// insertUI(interfaceFontStyle, lay, buildFontStyleList());
|
||||
//qobject_cast<QComboBox*>(m_controlIdMap.key(interfaceFontStyle))
|
||||
// ->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled()) {
|
||||
insertUI(interfaceFont, lay); // creates QFontComboBox
|
||||
insertUI(interfaceFontStyle, lay, buildFontStyleList());
|
||||
qobject_cast<QComboBox*>(m_controlIdMap.key(interfaceFontStyle))
|
||||
->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||
}
|
||||
|
||||
QGridLayout* colorCalibLay = insertGroupBoxUI(colorCalibrationEnabled, lay);
|
||||
{ insertUI(colorCalibrationLutPaths, colorCalibLay); }
|
||||
|
@ -1711,16 +1741,18 @@ QWidget* PreferencesPopup::createInterfacePage() {
|
|||
row = lay->rowCount();
|
||||
lay->addWidget(check30bitBtn, row - 1, 2, Qt::AlignRight);
|
||||
#endif
|
||||
// insertUI(showIconsInMenu, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(showIconsInMenu, lay);
|
||||
|
||||
lay->setRowStretch(lay->rowCount(), 1);
|
||||
insertFootNote(lay);
|
||||
widget->setLayout(lay);
|
||||
|
||||
// if (m_pref->getBoolValue(pixelsOnly)) {
|
||||
// m_controlIdMap.key(linearUnits)->setDisabled(true);
|
||||
// m_controlIdMap.key(cameraUnits)->setDisabled(true);
|
||||
//}
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
m_pref->getBoolValue(pixelsOnly)) {
|
||||
m_controlIdMap.key(linearUnits)->setDisabled(true);
|
||||
m_controlIdMap.key(cameraUnits)->setDisabled(true);
|
||||
}
|
||||
// pixels unit may deactivated externally on loading scene (see
|
||||
// IoCmd::loadScene())
|
||||
bool ret = true;
|
||||
|
@ -1735,12 +1767,11 @@ QWidget* PreferencesPopup::createInterfacePage() {
|
|||
|
||||
m_onEditedFuncMap.insert(CurrentStyleSheetName,
|
||||
&PreferencesPopup::onStyleSheetTypeChanged);
|
||||
// m_onEditedFuncMap.insert(pixelsOnly,
|
||||
// &PreferencesPopup::onPixelsOnlyChanged);
|
||||
// m_onEditedFuncMap.insert(linearUnits, &PreferencesPopup::onUnitChanged);
|
||||
// m_onEditedFuncMap.insert(cameraUnits, &PreferencesPopup::onUnitChanged);
|
||||
// m_preEditedFuncMap.insert(CurrentRoomChoice,
|
||||
// &PreferencesPopup::beforeRoomChoiceChanged);
|
||||
m_onEditedFuncMap.insert(pixelsOnly, &PreferencesPopup::onPixelsOnlyChanged);
|
||||
m_onEditedFuncMap.insert(linearUnits, &PreferencesPopup::onUnitChanged);
|
||||
m_onEditedFuncMap.insert(cameraUnits, &PreferencesPopup::onUnitChanged);
|
||||
m_preEditedFuncMap.insert(CurrentRoomChoice,
|
||||
&PreferencesPopup::beforeRoomChoiceChanged);
|
||||
m_onEditedFuncMap.insert(colorCalibrationEnabled,
|
||||
&PreferencesPopup::onColorCalibrationChanged);
|
||||
|
||||
|
@ -1784,7 +1815,8 @@ QWidget* PreferencesPopup::createLoadingPage() {
|
|||
{ insertUI(autoRemoveUnusedLevels, autoExposeLay); }
|
||||
insertUI(subsceneFolderEnabled, lay);
|
||||
insertUI(removeSceneNumberFromLoadedLevelName, lay);
|
||||
// insertUI(IgnoreImageDpi, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(IgnoreImageDpi, lay);
|
||||
insertUI(initialLoadTlvCachingBehavior, lay,
|
||||
getComboItemList(initialLoadTlvCachingBehavior));
|
||||
insertUI(columnIconLoadingPolicy, lay,
|
||||
|
@ -1913,7 +1945,8 @@ QWidget* PreferencesPopup::createDrawingPage() {
|
|||
lay->addWidget(frameFormatBtn, row - 1, 2, Qt::AlignLeft);
|
||||
insertUI(newLevelSizeToCameraSizeEnabled, lay);
|
||||
insertDualUIs(DefLevelWidth, DefLevelHeight, lay);
|
||||
// insertUI(DefLevelDpi, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(DefLevelDpi, lay);
|
||||
QGridLayout* creationLay = insertGroupBox(
|
||||
tr("Frame Creation Options"), lay);
|
||||
{
|
||||
|
@ -1930,7 +1963,8 @@ QWidget* PreferencesPopup::createDrawingPage() {
|
|||
insertUI(saveUnpaintedInCleanup, lay);
|
||||
insertUI(minimizeSaveboxAfterEditing, lay);
|
||||
insertUI(useNumpadForSwitchingStyles, lay);
|
||||
// insertUI(downArrowInLevelStripCreatesNewFrame, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(downArrowInLevelStripCreatesNewFrame, lay);
|
||||
QGridLayout* replaceVectorsLay = insertGroupBox(
|
||||
tr("Replace Vectors with Simplified Vectors Command"), lay);
|
||||
{
|
||||
|
@ -1947,11 +1981,12 @@ QWidget* PreferencesPopup::createDrawingPage() {
|
|||
|
||||
onDefLevelTypeChanged();
|
||||
|
||||
// if (m_pref->getBoolValue(pixelsOnly)) {
|
||||
// m_controlIdMap.key(DefLevelDpi)->setDisabled(true);
|
||||
getUI<MeasuredDoubleLineEdit*>(DefLevelWidth)->setDecimals(0);
|
||||
getUI<MeasuredDoubleLineEdit*>(DefLevelHeight)->setDecimals(0);
|
||||
//}
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
m_pref->getBoolValue(pixelsOnly)) {
|
||||
m_controlIdMap.key(DefLevelDpi)->setDisabled(true);
|
||||
getUI<MeasuredDoubleLineEdit*>(DefLevelWidth)->setDecimals(0);
|
||||
getUI<MeasuredDoubleLineEdit*>(DefLevelHeight)->setDecimals(0);
|
||||
}
|
||||
|
||||
bool ret = ret && connect(frameFormatBtn, SIGNAL(clicked()), this,
|
||||
SLOT(onFrameFormatButton()));
|
||||
|
@ -1968,7 +2003,8 @@ QWidget* PreferencesPopup::createToolsPage() {
|
|||
|
||||
// insertUI(dropdownShortcutsCycleOptions, lay,
|
||||
// getComboItemList(dropdownShortcutsCycleOptions));
|
||||
// insertUI(FillOnlysavebox, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(FillOnlysavebox, lay);
|
||||
insertUI(multiLayerStylePickerEnabled, lay);
|
||||
QGridLayout* cursorOptionsLay = insertGroupBox(tr("Cursor Options"), lay);
|
||||
{
|
||||
|
@ -1980,7 +2016,8 @@ QWidget* PreferencesPopup::createToolsPage() {
|
|||
}
|
||||
insertUI(levelBasedToolsDisplay, lay,
|
||||
getComboItemList(levelBasedToolsDisplay));
|
||||
// insertUI(useCtrlAltToResizeBrush, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(useCtrlAltToResizeBrush, lay);
|
||||
insertUI(temptoolswitchtimer, lay);
|
||||
|
||||
lay->setRowStretch(lay->rowCount(), 1);
|
||||
|
@ -2019,11 +2056,14 @@ QWidget* PreferencesPopup::createXsheetPage() {
|
|||
insertUI(showColumnNumbers, lay);
|
||||
insertUI(parentColorsInXsheetColumn, lay);
|
||||
insertUI(highlightLineEverySecond, lay);
|
||||
// insertUI(syncLevelRenumberWithXsheet, lay);
|
||||
// insertUI(currentTimelineEnabled, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled()) {
|
||||
insertUI(syncLevelRenumberWithXsheet, lay);
|
||||
insertUI(currentTimelineEnabled, lay);
|
||||
}
|
||||
// insertUI(currentColumnColor, lay);
|
||||
insertUI(currentCellColor, lay);
|
||||
// insertUI(showFrameNumberWithLetters, lay);
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
insertUI(showFrameNumberWithLetters, lay);
|
||||
|
||||
lay->setRowStretch(lay->rowCount(), 1);
|
||||
insertFootNote(lay);
|
||||
|
|
|
@ -140,6 +140,7 @@ private:
|
|||
void onAutoSaveOptionsChanged();
|
||||
void onWatchFileSystemClicked();
|
||||
void onPathAliasPriorityChanged();
|
||||
void onShowAdvancedOptionsChanged();
|
||||
// Interface
|
||||
void onStyleSheetTypeChanged();
|
||||
// void onIconThemeChanged();
|
||||
|
|
|
@ -109,23 +109,24 @@ StartupPopup::StartupPopup()
|
|||
.getParentDir()
|
||||
.getQString();
|
||||
m_projectLocationFld->setPath(currProjectPath);
|
||||
m_projectsCB = new QComboBox(this);
|
||||
m_sceneNameLabel = new QLabel(tr("Scene Name:"));
|
||||
m_widthLabel = new QLabel(tr("Width:"), this);
|
||||
m_widthFld = new MeasuredDoubleLineEdit(this);
|
||||
m_heightLabel = new QLabel(tr("Height:"), this);
|
||||
m_heightFld = new MeasuredDoubleLineEdit(this);
|
||||
// m_dpiLabel = new QLabel(tr("DPI:"), this);
|
||||
// m_dpiFld = new DoubleLineEdit(this, 120);
|
||||
m_resXLabel = new QLabel(tr("X"), this);
|
||||
m_resXFld = new DoubleLineEdit(this);
|
||||
m_resYFld = new DoubleLineEdit(this);
|
||||
m_resTextLabel = new QLabel(tr("Resolution:"), this);
|
||||
m_fpsLabel = new QLabel(tr("Frame Rate:"), this);
|
||||
m_fpsFld = new DoubleLineEdit(this, 24.0);
|
||||
m_cameraSettingsWidget = new CameraSettingsWidget(false);
|
||||
m_presetCombo = new QComboBox(this);
|
||||
// m_unitsCB = new QComboBox(this);
|
||||
m_projectsCB = new QComboBox(this);
|
||||
m_sceneNameLabel = new QLabel(tr("Scene Name:"));
|
||||
m_widthLabel = new QLabel(tr("Width:"), this);
|
||||
m_widthFld = new MeasuredDoubleLineEdit(this);
|
||||
m_heightLabel = new QLabel(tr("Height:"), this);
|
||||
m_heightFld = new MeasuredDoubleLineEdit(this);
|
||||
m_dpiLabel = new QLabel(tr("DPI:"), this);
|
||||
m_dpiFld = new DoubleLineEdit(this, 120);
|
||||
m_resXLabel = new QLabel(tr("X"), this);
|
||||
m_resXFld = new DoubleLineEdit(this);
|
||||
m_resYFld = new DoubleLineEdit(this);
|
||||
m_resTextLabel = new QLabel(tr("Resolution:"), this);
|
||||
m_fpsLabel = new QLabel(tr("Frame Rate:"), this);
|
||||
m_fpsFld = new DoubleLineEdit(this, 24.0);
|
||||
m_cameraSettingsWidget = new CameraSettingsWidget(false);
|
||||
m_presetCombo = new QComboBox(this);
|
||||
m_unitsLabel = new QLabel(tr("Units:"), this);
|
||||
m_unitsCB = new QComboBox(this);
|
||||
m_addPresetBtn = new QPushButton(tr("Add"), this);
|
||||
m_removePresetBtn = new QPushButton(tr("Remove"), this);
|
||||
m_showAtStartCB = new QCheckBox(tr("Show this at startup"), this);
|
||||
|
@ -136,9 +137,9 @@ StartupPopup::StartupPopup()
|
|||
|
||||
QPushButton *loadOtherSceneButton =
|
||||
new QPushButton(tr("Open Another Scene..."), this);
|
||||
// QStringList type;
|
||||
// type << tr("pixel") << tr("cm") << tr("mm") << tr("inch") << tr("field");
|
||||
// m_unitsCB->addItems(type);
|
||||
QStringList type;
|
||||
type << tr("pixel") << tr("cm") << tr("mm") << tr("inch") << tr("field");
|
||||
m_unitsCB->addItems(type);
|
||||
|
||||
// Exclude all character which cannot fit in a filepath (Win).
|
||||
// Dots are also prohibited since they are internally managed by Toonz.
|
||||
|
@ -149,12 +150,15 @@ StartupPopup::StartupPopup()
|
|||
m_heightFld->setMeasure("camera.ly");
|
||||
m_widthFld->setFixedWidth(60);
|
||||
m_heightFld->setFixedWidth(60);
|
||||
m_resXFld->setFixedWidth(60);
|
||||
m_resYFld->setFixedWidth(60);
|
||||
m_dpiFld->setFixedWidth(60);
|
||||
|
||||
m_widthFld->setRange(0.1, (std::numeric_limits<double>::max)());
|
||||
m_heightFld->setRange(0.1, (std::numeric_limits<double>::max)());
|
||||
m_fpsFld->setRange(1.0, (std::numeric_limits<double>::max)());
|
||||
m_fpsFld->setFixedWidth(30);
|
||||
// m_dpiFld->setRange(1.0, (std::numeric_limits<double>::max)());
|
||||
m_dpiFld->setRange(1.0, (std::numeric_limits<double>::max)());
|
||||
m_resXFld->setRange(0.1, (std::numeric_limits<double>::max)());
|
||||
m_resYFld->setRange(0.1, (std::numeric_limits<double>::max)());
|
||||
m_autoSaveTimeFld->setRange(1, (std::numeric_limits<int>::max)());
|
||||
|
@ -250,6 +254,13 @@ StartupPopup::StartupPopup()
|
|||
newSceneLay->addWidget(m_resXLabel, 4, 2, 1, 1, Qt::AlignCenter);
|
||||
newSceneLay->addWidget(m_resYFld, 4, 3);
|
||||
|
||||
newSceneLay->addWidget(m_unitsLabel, 5, 0,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
newSceneLay->addWidget(m_unitsCB, 5, 1, 1, 1);
|
||||
newSceneLay->addWidget(m_dpiLabel, 5, 2,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
newSceneLay->addWidget(m_dpiFld, 5, 3, 1, 1);
|
||||
|
||||
newSceneLay->addWidget(createButton, 6, 1, 1, 3, Qt::AlignLeft);
|
||||
newSceneLay->setColumnStretch(4, 1);
|
||||
}
|
||||
|
@ -310,6 +321,8 @@ StartupPopup::StartupPopup()
|
|||
ret = ret && connect(m_presetCombo, SIGNAL(activated(const QString &)),
|
||||
SLOT(onPresetSelected(const QString &)));
|
||||
ret = ret && connect(m_addPresetBtn, SIGNAL(clicked()), SLOT(addPreset()));
|
||||
ret = ret && connect(m_unitsCB, SIGNAL(currentIndexChanged(int)),
|
||||
SLOT(onCameraUnitChanged(int)));
|
||||
ret = ret &&
|
||||
connect(m_removePresetBtn, SIGNAL(clicked()), SLOT(removePreset()));
|
||||
ret = ret && connect(m_nameFld, SIGNAL(returnPressedNow()), createButton,
|
||||
|
@ -353,13 +366,24 @@ void StartupPopup::showEvent(QShowEvent *) {
|
|||
->getFrameRate();
|
||||
m_widthFld->setValue(cameraSize.lx);
|
||||
m_heightFld->setValue(cameraSize.ly);
|
||||
if (Preferences::instance()->getCameraUnits() == "pixel") {
|
||||
|
||||
bool showAdvancedOptions =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled();
|
||||
if (!showAdvancedOptions && m_unitsCB->currentText() != "pixel")
|
||||
m_unitsCB->setCurrentText("pixel");
|
||||
|
||||
m_unitsLabel->setVisible(showAdvancedOptions);
|
||||
m_unitsCB->setVisible(showAdvancedOptions);
|
||||
if (!showAdvancedOptions ||
|
||||
Preferences::instance()->getCameraUnits() == "pixel") {
|
||||
m_widthFld->setDecimals(0);
|
||||
m_heightFld->setDecimals(0);
|
||||
m_resTextLabel->hide();
|
||||
m_resXFld->hide();
|
||||
m_resYFld->hide();
|
||||
m_resXLabel->hide();
|
||||
m_dpiLabel->hide();
|
||||
m_dpiFld->hide();
|
||||
} else {
|
||||
m_widthFld->setDecimals(4);
|
||||
m_heightFld->setDecimals(4);
|
||||
|
@ -367,10 +391,12 @@ void StartupPopup::showEvent(QShowEvent *) {
|
|||
m_resYFld->show();
|
||||
m_resXLabel->show();
|
||||
m_resTextLabel->show();
|
||||
m_dpiLabel->show();
|
||||
m_dpiFld->show();
|
||||
}
|
||||
|
||||
m_fpsFld->setValue(fps);
|
||||
// m_unitsCB->setCurrentText(Preferences::instance()->getCameraUnits());
|
||||
m_unitsCB->setCurrentText(Preferences::instance()->getCameraUnits());
|
||||
m_dpi = cameraRes.lx / cameraSize.lx;
|
||||
m_xRes = cameraRes.lx;
|
||||
m_yRes = cameraRes.ly;
|
||||
|
@ -1125,6 +1151,8 @@ void StartupPopup::onCameraUnitChanged(int index) {
|
|||
m_resXFld->show();
|
||||
m_resYFld->show();
|
||||
m_resXLabel->show();
|
||||
m_dpiFld->show();
|
||||
m_dpiLabel->show();
|
||||
m_widthFld->setMeasure("camera.lx");
|
||||
m_heightFld->setMeasure("camera.ly");
|
||||
m_widthFld->setValue(width);
|
||||
|
@ -1139,6 +1167,8 @@ void StartupPopup::onCameraUnitChanged(int index) {
|
|||
m_resXFld->hide();
|
||||
m_resYFld->hide();
|
||||
m_resXLabel->hide();
|
||||
m_dpiFld->hide();
|
||||
m_dpiLabel->hide();
|
||||
m_widthFld->setMeasure("camera.lx");
|
||||
m_heightFld->setMeasure("camera.ly");
|
||||
m_widthFld->setValue(m_xRes / Stage::standardDpi);
|
||||
|
|
|
@ -31,11 +31,12 @@ class StartupPopup final : public DVGui::Dialog {
|
|||
QLabel *m_widthLabel;
|
||||
QLabel *m_heightLabel;
|
||||
QLabel *m_fpsLabel;
|
||||
QLabel *m_unitsLabel;
|
||||
QLabel *m_resXLabel;
|
||||
QLabel *m_resTextLabel;
|
||||
// QLabel *m_dpiLabel;
|
||||
QLabel *m_dpiLabel;
|
||||
QLabel *m_sceneNameLabel;
|
||||
// DVGui::DoubleLineEdit *m_dpiFld;
|
||||
DVGui::DoubleLineEdit *m_dpiFld;
|
||||
DVGui::MeasuredDoubleLineEdit *m_widthFld;
|
||||
DVGui::MeasuredDoubleLineEdit *m_heightFld;
|
||||
DVGui::DoubleLineEdit *m_fpsFld;
|
||||
|
@ -46,7 +47,7 @@ class StartupPopup final : public DVGui::Dialog {
|
|||
QList<TFilePath> m_projectPaths;
|
||||
QCheckBox *m_showAtStartCB;
|
||||
QCheckBox *m_autoSaveOnCB;
|
||||
// QComboBox *m_unitsCB;
|
||||
QComboBox *m_unitsCB;
|
||||
QPushButton *m_loadOtherSceneButton;
|
||||
QPushButton *m_newProjectButton;
|
||||
QComboBox *m_presetCombo;
|
||||
|
|
|
@ -462,7 +462,7 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
|||
#endif
|
||||
: QFrame(parent)
|
||||
, m_viewer(parent)
|
||||
// , m_flipOrientationButton(nullptr)
|
||||
, m_flipOrientationButton(nullptr)
|
||||
, m_noteButton(nullptr)
|
||||
, m_precNoteButton(nullptr)
|
||||
, m_nextNoteButton(nullptr)
|
||||
|
@ -475,7 +475,7 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
|||
setFrameStyle(QFrame::StyledPanel);
|
||||
setObjectName("cornerWidget");
|
||||
|
||||
// m_flipOrientationButton = new QPushButton(this);
|
||||
m_flipOrientationButton = new QPushButton(this);
|
||||
m_noteButton = new QToolButton(this);
|
||||
m_precNoteButton = new QToolButton(this);
|
||||
m_nextNoteButton = new QToolButton(this);
|
||||
|
@ -484,13 +484,13 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
|||
m_layerHeaderPanel = new LayerHeaderPanel(m_viewer, this);
|
||||
|
||||
//-----
|
||||
//
|
||||
// m_flipOrientationButton->setObjectName("flipOrientationButton");
|
||||
// m_flipOrientationButton->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
// m_flipOrientationButton->setFixedSize(QSize(70, 23));
|
||||
// m_flipOrientationButton->setIconSize(QSize(20, 20));
|
||||
// m_flipOrientationButton->setIcon(createQIcon("toggle_xsheet_orientation"));
|
||||
// m_flipOrientationButton->setToolTip(tr("Toggle Xsheet/Timeline"));
|
||||
|
||||
m_flipOrientationButton->setObjectName("flipOrientationButton");
|
||||
m_flipOrientationButton->setFocusPolicy(Qt::FocusPolicy::NoFocus);
|
||||
m_flipOrientationButton->setFixedSize(QSize(70, 23));
|
||||
m_flipOrientationButton->setIconSize(QSize(20, 20));
|
||||
m_flipOrientationButton->setIcon(createQIcon("toggle_xsheet_orientation"));
|
||||
m_flipOrientationButton->setToolTip(tr("Toggle Xsheet/Timeline"));
|
||||
|
||||
m_newLevelButton->setObjectName("ToolbarToolButton");
|
||||
m_newLevelButton->setFixedSize(34, 25);
|
||||
|
@ -527,14 +527,18 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
|||
m_frameDisplayStyleCombo->addItems(frameDisplayStyles);
|
||||
m_frameDisplayStyleCombo->setCurrentIndex(
|
||||
(int)m_viewer->getFrameDisplayStyle());
|
||||
m_frameDisplayStyleCombo->hide();
|
||||
|
||||
if (!Preferences::instance()->isShowAdvancedOptionsEnabled()) {
|
||||
m_flipOrientationButton->hide();
|
||||
m_frameDisplayStyleCombo->hide();
|
||||
}
|
||||
|
||||
createLayout();
|
||||
|
||||
// signal-slot connections
|
||||
bool ret = true;
|
||||
// ret = ret && connect(m_flipOrientationButton, SIGNAL(clicked()),
|
||||
// SLOT(flipOrientation()));
|
||||
ret = ret && connect(m_flipOrientationButton, SIGNAL(clicked()),
|
||||
SLOT(flipOrientation()));
|
||||
|
||||
ret = ret && connect(m_noteButton, SIGNAL(clicked()), SLOT(toggleNewNote()));
|
||||
ret = ret &&
|
||||
|
@ -563,7 +567,7 @@ NoteArea::NoteArea(XsheetViewer *parent, Qt::WFlags flags)
|
|||
void NoteArea::removeLayout() {
|
||||
if (!m_currentLayout) return;
|
||||
|
||||
// m_currentLayout->removeWidget(m_flipOrientationButton);
|
||||
m_currentLayout->removeWidget(m_flipOrientationButton);
|
||||
m_currentLayout->removeWidget(m_noteButton);
|
||||
m_currentLayout->removeWidget(m_precNoteButton);
|
||||
m_currentLayout->removeWidget(m_nextNoteButton);
|
||||
|
@ -624,6 +628,8 @@ void NoteArea::createLayout() {
|
|||
mainLayout->setMargin(1);
|
||||
mainLayout->setSpacing(0);
|
||||
{
|
||||
mainLayout->addWidget(m_flipOrientationButton, 0, centerAlign);
|
||||
|
||||
mainLayout->addStretch(1);
|
||||
|
||||
mainLayout->addWidget(m_newLevelButton, 0, centerAlign);
|
||||
|
@ -681,13 +687,13 @@ void NoteArea::updateButtons() {
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// void NoteArea::flipOrientation() { m_viewer->flipOrientation(); }
|
||||
void NoteArea::flipOrientation() { m_viewer->flipOrientation(); }
|
||||
|
||||
void NoteArea::onXsheetOrientationChanged(const Orientation *newOrientation) {
|
||||
// m_flipOrientationButton->setText(newOrientation->caption());
|
||||
// m_flipOrientationButton->setText(newOrientation->caption());
|
||||
|
||||
// m_flipOrientationButton->setIcon(createQIcon("toggle_xsheet_orientation"));
|
||||
// m_flipOrientationButton->setIconSize(QSize(20, 20));
|
||||
m_flipOrientationButton->setIcon(createQIcon("toggle_xsheet_orientation"));
|
||||
m_flipOrientationButton->setIconSize(QSize(20, 20));
|
||||
|
||||
removeLayout();
|
||||
createLayout();
|
||||
|
|
|
@ -121,7 +121,7 @@ class NoteArea final : public QFrame {
|
|||
|
||||
XsheetViewer *m_viewer;
|
||||
|
||||
// QPushButton *m_flipOrientationButton;
|
||||
QPushButton *m_flipOrientationButton;
|
||||
|
||||
QToolButton *m_noteButton;
|
||||
QToolButton *m_nextNoteButton;
|
||||
|
@ -146,7 +146,7 @@ public:
|
|||
void updateButtons();
|
||||
|
||||
protected slots:
|
||||
// void flipOrientation();
|
||||
void flipOrientation();
|
||||
void toggleNewNote();
|
||||
void nextNote();
|
||||
void precNote();
|
||||
|
|
|
@ -395,6 +395,8 @@ void Preferences::definePreferenceItems() {
|
|||
define(pathAliasPriority, "pathAliasPriority", QMetaType::Int,
|
||||
(int)ProjectFolderOnly);
|
||||
|
||||
define(showAdvancedOptions, "showAdvancedOptions", QMetaType::Bool, false);
|
||||
|
||||
setCallBack(autosaveEnabled, &Preferences::enableAutosave);
|
||||
setCallBack(autosavePeriod, &Preferences::setAutosavePeriod);
|
||||
setCallBack(undoMemorySize, &Preferences::setUndoMemorySize);
|
||||
|
@ -551,7 +553,7 @@ void Preferences::definePreferenceItems() {
|
|||
define(levelBasedToolsDisplay, "levelBasedToolsDisplay", QMetaType::Int,
|
||||
0); // Default
|
||||
define(useCtrlAltToResizeBrush, "useCtrlAltToResizeBrush", QMetaType::Bool,
|
||||
true);
|
||||
false);
|
||||
define(temptoolswitchtimer, "temptoolswitchtimer", QMetaType::Int, 500, 1,
|
||||
std::numeric_limits<int>::max());
|
||||
|
||||
|
|
|
@ -65,6 +65,10 @@ QString removeZeros(QString srcStr) {
|
|||
}
|
||||
return srcStr;
|
||||
}
|
||||
|
||||
// Preference values of the unit - translation text
|
||||
QMap<QString, QString> unitTrMap;
|
||||
|
||||
} // namespace
|
||||
|
||||
//=============================================================================
|
||||
|
@ -175,6 +179,17 @@ CameraSettingsWidget::CameraSettingsWidget(bool forCleanup)
|
|||
, m_arValue(0)
|
||||
, m_presetListFile("")
|
||||
, m_currentLevel(0) {
|
||||
bool showAdvancedOptions =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled();
|
||||
|
||||
if (unitTrMap.isEmpty()) {
|
||||
unitTrMap["cm"] = tr("cm");
|
||||
unitTrMap["mm"] = tr("mm");
|
||||
unitTrMap["inch"] = tr("inch");
|
||||
unitTrMap["field"] = tr("field");
|
||||
unitTrMap["pixel"] = tr("pixel");
|
||||
}
|
||||
|
||||
m_xPrev = new QRadioButton();
|
||||
m_yPrev = new QRadioButton();
|
||||
m_arPrev = new QRadioButton();
|
||||
|
@ -192,12 +207,14 @@ CameraSettingsWidget::CameraSettingsWidget(bool forCleanup)
|
|||
m_yDpiFld = new DoubleLineEdit();
|
||||
m_unitLabel = new QLabel();
|
||||
if (Preferences::instance()->getPixelsOnly())
|
||||
m_unitLabel->setText(tr("Size"));
|
||||
m_unitLabel->setText(showAdvancedOptions ? tr("Pixels") : tr("Size"));
|
||||
else
|
||||
m_unitLabel->setText(Preferences::instance()->getCameraUnits());
|
||||
m_unitLabel->setText(
|
||||
unitTrMap.value(Preferences::instance()->getCameraUnits()));
|
||||
m_dpiLabel = new QLabel(tr("DPI"));
|
||||
m_resLabel = new QLabel(tr("Size"));
|
||||
m_resLabel = new QLabel(showAdvancedOptions ? tr("Pixels") : tr("Size"));
|
||||
m_xLabel = new QLabel(tr("x"));
|
||||
m_arLabel = new QLabel(tr("A/R"));
|
||||
|
||||
m_fspChk = new QPushButton("");
|
||||
|
||||
|
@ -269,8 +286,13 @@ CameraSettingsWidget::CameraSettingsWidget(bool forCleanup)
|
|||
group = new QButtonGroup;
|
||||
group->addButton(m_inchPrev);
|
||||
group->addButton(m_dotPrev);
|
||||
m_xPrev->setChecked(true);
|
||||
m_inchPrev->setChecked(true);
|
||||
if (showAdvancedOptions) {
|
||||
m_arPrev->setChecked(true);
|
||||
m_dotPrev->setChecked(true);
|
||||
} else {
|
||||
m_xPrev->setChecked(true);
|
||||
m_inchPrev->setChecked(true);
|
||||
}
|
||||
|
||||
//------ layout
|
||||
|
||||
|
@ -284,20 +306,25 @@ CameraSettingsWidget::CameraSettingsWidget(bool forCleanup)
|
|||
{
|
||||
gridLay->addWidget(m_xPrev, 0, 2, Qt::AlignCenter);
|
||||
gridLay->addWidget(m_yPrev, 0, 4, Qt::AlignCenter);
|
||||
m_xPrev->hide();
|
||||
m_yPrev->hide();
|
||||
if (!showAdvancedOptions) {
|
||||
m_xPrev->hide();
|
||||
m_yPrev->hide();
|
||||
}
|
||||
gridLay->addWidget(m_inchPrev, 1, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_inchPrev->hide();
|
||||
if (!showAdvancedOptions) m_inchPrev->hide();
|
||||
gridLay->addWidget(m_unitLabel, 1, 1, Qt::AlignRight | Qt::AlignVCenter);
|
||||
gridLay->addWidget(m_lxFld, 1, 2);
|
||||
gridLay->addWidget(new QLabel("x"), 1, 3, Qt::AlignCenter);
|
||||
gridLay->addWidget(m_lyFld, 1, 4);
|
||||
|
||||
gridLay->addWidget(m_arPrev, 2, 2, Qt::AlignRight | Qt::AlignVCenter);
|
||||
// gridLay->addWidget(new QLabel(tr("A/R")), 2, 3, Qt::AlignCenter);
|
||||
gridLay->addWidget(m_arLabel, 2, 3, Qt::AlignCenter);
|
||||
gridLay->addWidget(m_arFld, 2, 4);
|
||||
m_arFld->hide();
|
||||
m_arPrev->hide();
|
||||
if (!showAdvancedOptions) {
|
||||
m_arLabel->hide();
|
||||
m_arFld->hide();
|
||||
m_arPrev->hide();
|
||||
}
|
||||
|
||||
gridLay->addWidget(m_dotPrev, 3, 0, Qt::AlignRight | Qt::AlignVCenter);
|
||||
gridLay->addWidget(m_resLabel, 3, 1, Qt::AlignRight | Qt::AlignVCenter);
|
||||
|
@ -386,7 +413,6 @@ void CameraSettingsWidget::showEvent(QShowEvent *e) {
|
|||
m_yDpiFld->hide();
|
||||
m_fspChk->hide();
|
||||
m_dotPrev->hide();
|
||||
m_arFld->hide();
|
||||
m_lxFld->setDecimals(0);
|
||||
m_lyFld->setDecimals(0);
|
||||
} else {
|
||||
|
@ -405,7 +431,8 @@ void CameraSettingsWidget::showEvent(QShowEvent *e) {
|
|||
if (Preferences::instance()->getPixelsOnly())
|
||||
m_unitLabel->setText(tr("Pixels"));
|
||||
else
|
||||
m_unitLabel->setText(Preferences::instance()->getCameraUnits());
|
||||
m_unitLabel->setText(
|
||||
unitTrMap.value(Preferences::instance()->getCameraUnits()));
|
||||
}
|
||||
|
||||
void CameraSettingsWidget::loadPresetList() {
|
||||
|
|
|
@ -358,7 +358,9 @@ QIcon createQIcon(const char *iconSVGName, bool useFullOpacity,
|
|||
QIcon icon;
|
||||
|
||||
#ifdef _WIN32
|
||||
bool showIconInMenu = false; //Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
bool showIconInMenu =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled() &&
|
||||
Preferences::instance()->getBoolValue(showIconsInMenu);
|
||||
// set transparent icon
|
||||
if (isForMenuItem &&
|
||||
themeIconPixmap.size() == QSize(16 * devPixRatio, 16 * devPixRatio) &&
|
||||
|
|
|
@ -349,9 +349,11 @@ void InfoViewerImp::setImageInfo() {
|
|||
setVal(eBitsSample, QString::number(ii->m_bitsPerSample));
|
||||
if (ii->m_samplePerPixel > 0)
|
||||
setVal(eSamplePixel, QString::number(ii->m_samplePerPixel));
|
||||
// if (ii->m_dpix > 0 || ii->m_dpiy > 0)
|
||||
// setVal(eDpi, "(" + QString::number(ii->m_dpix) + ", " +
|
||||
// QString::number(ii->m_dpiy) + ")");
|
||||
bool showAdvancedOptions =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled();
|
||||
if (showAdvancedOptions && (ii->m_dpix > 0 || ii->m_dpiy > 0))
|
||||
setVal(eDpi, "(" + QString::number(ii->m_dpix) + ", " +
|
||||
QString::number(ii->m_dpiy) + ")");
|
||||
TPropertyGroup *pg = ii->m_properties;
|
||||
if (pg) {
|
||||
setLabel(pg, eOrientation, "Orientation");
|
||||
|
@ -394,21 +396,25 @@ void InfoViewerImp::setImageInfo() {
|
|||
QString::number(r.x1) + ", " + QString::number(r.y1) + ")");
|
||||
}
|
||||
|
||||
// double dpix, dpiy;
|
||||
double dpix, dpiy;
|
||||
|
||||
if (timg) {
|
||||
// setVal(eHPos, QString::number(timg->gethPos()));
|
||||
// timg->getDpi(dpix, dpiy);
|
||||
// setVal(eDpi,
|
||||
// "(" + QString::number(dpix) + ", " + QString::number(dpiy) + ")");
|
||||
if (showAdvancedOptions) {
|
||||
// setVal(eHPos, QString::number(timg->gethPos()));
|
||||
timg->getDpi(dpix, dpiy);
|
||||
setVal(eDpi,
|
||||
"(" + QString::number(dpix) + ", " + QString::number(dpiy) + ")");
|
||||
}
|
||||
TDimension dim = timg->getRaster()->getSize();
|
||||
setVal(eImageSize,
|
||||
QString::number(dim.lx) + " X " + QString::number(dim.ly));
|
||||
m_palette = timg->getPalette();
|
||||
} else if (rimg) {
|
||||
/*rimg->getDpi(dpix, dpiy);
|
||||
setVal(eDpi,
|
||||
"(" + QString::number(dpix) + ", " + QString::number(dpiy) + ")");*/
|
||||
if (showAdvancedOptions) {
|
||||
rimg->getDpi(dpix, dpiy);
|
||||
setVal(eDpi,
|
||||
"(" + QString::number(dpix) + ", " + QString::number(dpiy) + ")");
|
||||
}
|
||||
TDimension dim = rimg->getRaster()->getSize();
|
||||
setVal(eImageSize,
|
||||
QString::number(dim.lx) + " X " + QString::number(dim.ly));
|
||||
|
@ -493,8 +499,9 @@ void InfoViewerImp::setToonzSceneInfo() {
|
|||
|
||||
setVal(eCamera, QString::number(cam->getRes().lx) + " X " +
|
||||
QString::number(cam->getRes().ly));
|
||||
// setVal(eCameraDpi, QString::number(cam->getDpi().x) + ", " +
|
||||
// QString::number(cam->getDpi().y));
|
||||
if (Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
setVal(eCameraDpi, QString::number(cam->getDpi().x) + ", " +
|
||||
QString::number(cam->getDpi().y));
|
||||
setVal(eFrameCount, QString::number(scene.getFrameCount()));
|
||||
if (set) setVal(eLevelCount, QString::number(set->getLevelCount()));
|
||||
|
||||
|
|
|
@ -4179,12 +4179,14 @@ void StyleEditor::setPaletteHandle(TPaletteHandle* paletteHandle)
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
QFrame *StyleEditor::createBottomWidget() {
|
||||
bool showAdvancedOptions =
|
||||
Preferences::instance()->isShowAdvancedOptionsEnabled();
|
||||
|
||||
QFrame *bottomWidget = new QFrame(this);
|
||||
m_autoButton = new QPushButton(tr("Auto"));
|
||||
m_oldColor = new DVGui::StyleSample(this, 42, 24);
|
||||
m_newColor = new DVGui::StyleSample(this, 42, 24);
|
||||
m_applyButton = new QPushButton(tr("Apply"));
|
||||
m_fillColorWidget = new QFrame(this);
|
||||
|
||||
bottomWidget->setFrameStyle(QFrame::StyledPanel);
|
||||
bottomWidget->setObjectName("bottomWidget");
|
||||
|
@ -4251,6 +4253,11 @@ QFrame *StyleEditor::createBottomWidget() {
|
|||
new QAction(createQIcon("orientation_h"), tr("Toggle Orientation"), this);
|
||||
menu->addAction(m_toggleOrientationAction);
|
||||
|
||||
if (showAdvancedOptions) {
|
||||
m_toggleAutoApply = new QAction(tr("Hide Auto/Apply"), this);
|
||||
menu->addAction(m_toggleAutoApply);
|
||||
}
|
||||
|
||||
m_hexEditorAction = new QAction(tr("Hex Color Names..."), this);
|
||||
menu->addAction(m_hexEditorAction);
|
||||
|
||||
|
@ -4273,21 +4280,24 @@ QFrame *StyleEditor::createBottomWidget() {
|
|||
m_toolBar->setMaximumHeight(22);
|
||||
m_toolBar->setIconSize(QSize(16, 16));
|
||||
|
||||
m_fillColorWidget->setMinimumHeight(24);
|
||||
m_fillColorWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
QHBoxLayout *fillColorLayout = new QHBoxLayout(this);
|
||||
fillColorLayout->addWidget(new QLabel(" ", this));
|
||||
m_fillColorWidget->setLayout(fillColorLayout);
|
||||
m_autoApplyWidget = new QWidget(this);
|
||||
QHBoxLayout *autoApplyLayout = new QHBoxLayout;
|
||||
autoApplyLayout->setMargin(0);
|
||||
autoApplyLayout->setSpacing(0);
|
||||
{
|
||||
autoApplyLayout->addWidget(m_autoButton);
|
||||
autoApplyLayout->addSpacing(4);
|
||||
autoApplyLayout->addWidget(m_applyButton);
|
||||
autoApplyLayout->addSpacing(4);
|
||||
}
|
||||
m_autoApplyWidget->setLayout(autoApplyLayout);
|
||||
|
||||
/* ------ layout ------ */
|
||||
QHBoxLayout *mainLayout = new QHBoxLayout;
|
||||
mainLayout->setMargin(2);
|
||||
mainLayout->setSpacing(0);
|
||||
{
|
||||
mainLayout->addWidget(m_autoButton);
|
||||
// mainLayout->addSpacing(4);
|
||||
mainLayout->addWidget(m_applyButton);
|
||||
// mainLayout->addSpacing(4);
|
||||
mainLayout->addWidget(m_autoApplyWidget);
|
||||
|
||||
QVBoxLayout *colorLay = new QVBoxLayout();
|
||||
colorLay->setMargin(0);
|
||||
|
@ -4299,7 +4309,6 @@ QFrame *StyleEditor::createBottomWidget() {
|
|||
{
|
||||
chipLay->addWidget(m_newColor, 1);
|
||||
chipLay->addWidget(m_oldColor, 1);
|
||||
chipLay->addWidget(m_fillColorWidget, 0);
|
||||
}
|
||||
colorLay->addLayout(chipLay, 1);
|
||||
colorLay->addSpacing(2);
|
||||
|
@ -4319,20 +4328,19 @@ QFrame *StyleEditor::createBottomWidget() {
|
|||
}
|
||||
bottomWidget->setLayout(mainLayout);
|
||||
|
||||
if (!showAdvancedOptions) m_autoApplyWidget->hide();
|
||||
m_oldColor->hide();
|
||||
m_autoButton->hide();
|
||||
m_applyButton->hide();
|
||||
|
||||
/* ------ signal-slot connections ------ */
|
||||
bool ret = true;
|
||||
// ret = ret && connect(m_applyButton, SIGNAL(clicked()), this,
|
||||
// SLOT(applyButtonClicked()));
|
||||
ret = ret && connect(m_applyButton, SIGNAL(clicked()), this,
|
||||
SLOT(applyButtonClicked()));
|
||||
ret = ret && connect(m_autoButton, SIGNAL(toggled(bool)), this,
|
||||
SLOT(autoCheckChanged(bool)));
|
||||
// ret = ret &&
|
||||
// connect(m_oldColor, SIGNAL(clicked()), this, SLOT(onOldStyleClicked()));
|
||||
// ret = ret &&
|
||||
// connect(m_newColor, SIGNAL(clicked()), this, SLOT(onNewStyleClicked()));
|
||||
ret = ret &&
|
||||
connect(m_oldColor, SIGNAL(clicked()), this, SLOT(onOldStyleClicked()));
|
||||
ret = ret &&
|
||||
connect(m_newColor, SIGNAL(clicked()), this, SLOT(onNewStyleClicked()));
|
||||
ret = ret && connect(m_wheelAction, SIGNAL(toggled(bool)),
|
||||
m_plainColorPage->m_wheelFrame, SLOT(setVisible(bool)));
|
||||
ret = ret && connect(m_hsvAction, SIGNAL(toggled(bool)),
|
||||
|
@ -4349,6 +4357,9 @@ QFrame *StyleEditor::createBottomWidget() {
|
|||
SLOT(onHexEditor()));
|
||||
ret = ret && connect(m_toggleOrientationAction, SIGNAL(triggered()),
|
||||
m_plainColorPage, SLOT(toggleOrientation()));
|
||||
if (showAdvancedOptions)
|
||||
ret = ret && connect(m_toggleAutoApply, SIGNAL(triggered()), this,
|
||||
SLOT(onToggleAutoApply()));
|
||||
ret = ret && connect(m_toggleOrientationAction, SIGNAL(triggered()), this,
|
||||
SLOT(updateOrientationButton()));
|
||||
ret = ret && connect(menu, SIGNAL(aboutToHide()), this, SLOT(onHideMenu()));
|
||||
|
@ -4843,25 +4854,6 @@ void StyleEditor::onStyleChanged(bool isDragging) {
|
|||
m_colorParameterSelector->setStyle(*m_editedStyle);
|
||||
m_settingsPage->setStyle(m_editedStyle);
|
||||
m_newColor->setStyle(*m_editedStyle, getColorParam());
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1);}";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
m_oldColor->setStyle(
|
||||
*m_oldStyle,
|
||||
getColorParam()); // This line is needed for proper undo behavior
|
||||
|
@ -4955,24 +4947,6 @@ void StyleEditor::onColorChanged(const ColorModel &color, bool isDragging) {
|
|||
}
|
||||
|
||||
m_newColor->setStyle(*m_editedStyle, getColorParam());
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1);}";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
m_colorParameterSelector->setStyle(*m_editedStyle);
|
||||
m_hexLineEdit->setStyle(*m_editedStyle, getColorParam());
|
||||
|
||||
|
@ -5001,10 +4975,7 @@ void StyleEditor::enable(bool enabled, bool enabledOnlyFirstTab,
|
|||
if (enabled == false) {
|
||||
m_oldColor->setColor(TPixel32::Transparent);
|
||||
m_newColor->setColor(TPixel32::Transparent);
|
||||
m_fillColorWidget->setStyleSheet("background-color: rgba(0, 0, 0, 0);");
|
||||
m_fillColorWidget->hide();
|
||||
} else
|
||||
m_fillColorWidget->show();
|
||||
}
|
||||
}
|
||||
|
||||
// lock button behavior
|
||||
|
@ -5087,6 +5058,7 @@ void StyleEditor::autoCheckChanged(bool value) {
|
|||
if (!m_enabled) return;
|
||||
|
||||
m_applyButton->setDisabled(value);
|
||||
m_oldColor->setHidden(value);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -5129,24 +5101,6 @@ bool StyleEditor::setStyle(TColorStyle *currentStyle) {
|
|||
m_newColor->setStyle(*currentStyle, getColorParam());
|
||||
m_hexLineEdit->setStyle(*m_editedStyle, getColorParam());
|
||||
|
||||
int tag = currentStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
// TPixel32 color = currentStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1);}";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
setOldStyleToStyle(currentStyle);
|
||||
}
|
||||
|
||||
|
@ -5212,24 +5166,6 @@ void StyleEditor::selectStyle(const TColorStyle &newStyle) {
|
|||
|
||||
// Update editor widgets
|
||||
m_newColor->setStyle(*m_editedStyle, getColorParam());
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1); }";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
m_plainColorPage->setColor(*m_editedStyle, getColorParam());
|
||||
m_colorParameterSelector->setStyle(*m_editedStyle);
|
||||
m_settingsPage->setStyle(m_editedStyle);
|
||||
|
@ -5260,24 +5196,6 @@ void StyleEditor::addToPalette(const TColorStyle &newStyle) {
|
|||
// Update editor widgets
|
||||
m_newColor->setStyle(*m_editedStyle, getColorParam());
|
||||
m_oldColor->setStyle(*m_editedStyle, getColorParam());
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1); }";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
m_plainColorPage->setColor(*m_editedStyle, getColorParam());
|
||||
m_colorParameterSelector->setStyle(*m_editedStyle);
|
||||
m_settingsPage->setStyle(m_editedStyle);
|
||||
|
@ -5307,25 +5225,6 @@ void StyleEditor::onColorParamChanged() {
|
|||
m_settingsPage->setStyle(m_editedStyle);
|
||||
m_hexLineEdit->setStyle(*m_editedStyle, getColorParam());
|
||||
}
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
m_fillColorWidget->show();
|
||||
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1);}";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -5342,24 +5241,6 @@ void StyleEditor::onParamStyleChanged(bool isDragging) {
|
|||
m_editedStyle->invalidateIcon(); // Refresh the new color icon
|
||||
m_newColor->setStyle(*m_editedStyle, getColorParam());
|
||||
|
||||
int tag = m_editedStyle->getTagId();
|
||||
if (tag == 4 || tag == 2000 || tag == 2800 || getStyleIndex() == 0) {
|
||||
m_fillColorWidget->hide();
|
||||
} else {
|
||||
TPixel32 color = m_editedStyle->getColorParamValue(getColorParam());
|
||||
// TPixel32 color = m_editedStyle->getMainColor();
|
||||
QString hexColor = color2Hex(color);
|
||||
m_hexLineEdit->setText(hexColor);
|
||||
m_newColor->setToolTip(hexColor);
|
||||
m_fillColorWidget->setToolTip(hexColor);
|
||||
QString myColor = QString::number(color.r) + ", " +
|
||||
QString::number(color.g) + ", " +
|
||||
QString::number(color.b);
|
||||
std::string myColorStr = myColor.toStdString();
|
||||
m_fillColorWidget->show();
|
||||
QString styleSheet = "QFrame {background-color: rgb(%1);}";
|
||||
m_fillColorWidget->setStyleSheet(styleSheet.arg(myColor));
|
||||
}
|
||||
m_hexLineEdit->setStyle(*m_editedStyle, getColorParam());
|
||||
}
|
||||
|
||||
|
@ -5429,6 +5310,21 @@ void StyleEditor::onPageChanged(int index) {
|
|||
update();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void StyleEditor::onToggleAutoApply() {
|
||||
if (!m_toggleAutoApply ||
|
||||
!Preferences::instance()->isShowAdvancedOptionsEnabled())
|
||||
return;
|
||||
|
||||
m_showAutoApply = !m_showAutoApply;
|
||||
if (!m_showAutoApply && !m_autoButton->isChecked())
|
||||
m_autoButton->setChecked(true);
|
||||
m_autoApplyWidget->setHidden(!m_showAutoApply);
|
||||
m_toggleAutoApply->setText(m_showAutoApply ? tr("Hide Auto/Apply")
|
||||
: tr("Show Auto/Apply"));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
QStringList StyleEditor::savePageStates(StylePageType pageType) const {
|
||||
QStringList pageStateData;
|
||||
|
@ -5530,6 +5426,7 @@ void StyleEditor::save(QSettings &settings) const {
|
|||
settings.setValue("vectorPageStates",
|
||||
savePageStates(StylePageType::VectorCustom));
|
||||
settings.setValue("rasterPageStates", savePageStates(StylePageType::Raster));
|
||||
settings.setValue("showAutoApply", m_showAutoApply);
|
||||
}
|
||||
void StyleEditor::load(QSettings &settings) {
|
||||
QVariant isVertical = settings.value("isVertical");
|
||||
|
@ -5578,6 +5475,11 @@ void StyleEditor::load(QSettings &settings) {
|
|||
QVariant rasterPageStates = settings.value("rasterPageStates");
|
||||
if (rasterPageStates.canConvert(QVariant::StringList))
|
||||
loadPageStates(StylePageType::Raster, rasterPageStates.toStringList());
|
||||
|
||||
QVariant showAutoApply = settings.value("showAutoApply");
|
||||
if (showAutoApply.canConvert(QVariant::Bool)) {
|
||||
if (showAutoApply.toBool() != m_showAutoApply) onToggleAutoApply();
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue