[LY-105687]

Jira: LY-105687
https://jira.agscollab.com/browse/LY-105687

Renamed svg
This commit is contained in:
sphrose
2021-04-16 10:59:27 +01:00
parent 41eadd60e4
commit 2a339edc4e
7 changed files with 98 additions and 7 deletions
@@ -159,6 +159,8 @@ namespace AzQtComponents
// Timer for updating our hovered drop zone opacity
QObject::connect(m_dropZoneHoverFadeInTimer, &QTimer::timeout, this, &FancyDocking::onDropZoneHoverFadeInUpdate);
m_dropZoneHoverFadeInTimer->setInterval(g_FancyDockingConstants.dropZoneHoverFadeUpdateIntervalMS);
QIcon dragIcon = QIcon(QStringLiteral(":/Cursors/Grabbing.svg"));
m_dragCursor = QCursor(dragIcon.pixmap(32), 10, 5);
}
FancyDocking::~FancyDocking()
@@ -1884,6 +1886,8 @@ namespace AzQtComponents
return;
}
QApplication::setOverrideCursor(m_dragCursor);
QPoint relativePressPos = pressPos;
// If we are dragging a floating window, we need to grab a reference to its
@@ -1999,6 +2003,11 @@ namespace AzQtComponents
clearDraggingState();
}
if (QApplication::overrideCursor())
{
QApplication::restoreOverrideCursor();
}
return true;
}
@@ -2376,6 +2385,11 @@ namespace AzQtComponents
*/
void FancyDocking::dropDockWidget(QDockWidget* dock, QWidget* onto, Qt::DockWidgetArea area)
{
if (QApplication::overrideCursor())
{
QApplication::restoreOverrideCursor();
}
// If the dock widget we are dropping is currently a tab, we need to retrieve it from
// the tab widget, and remove it as a tab. We also need to remove its item from our
// cache of widget <-> tab container since we are moving it somewhere else.
@@ -266,6 +266,8 @@ namespace AzQtComponents
QString m_floatingWindowIdentifierPrefix;
QString m_tabContainerIdentifierPrefix;
QCursor m_dragCursor;
};
} // namespace AzQtComponents
@@ -21,6 +21,7 @@
#include <QAction>
#include <QActionEvent>
#include <QApplication>
#include <QHBoxLayout>
#include <QIcon>
#include <QLayout>
@@ -419,6 +420,14 @@ namespace AzQtComponents
// a mouse move. The paint handler updates the close button's visibility
setAttribute(Qt::WA_Hover);
AzQtComponents::Style::addClass(this, g_emptyStyleClass);
QIcon icon = QIcon(QStringLiteral(":/Cursors/Grab_release.svg"));
m_hoverCursor = QCursor(icon.pixmap(32), 10, 5);
icon = QIcon(QStringLiteral(":/Cursors/Grabbing.svg"));
m_dragCursor = QCursor(icon.pixmap(32), 10, 5);
this->setCursor(m_hoverCursor);
}
void TabBar::setHandleOverflow(bool handleOverflow)
@@ -479,6 +488,13 @@ namespace AzQtComponents
void TabBar::mouseReleaseEvent(QMouseEvent* mouseEvent)
{
// Ensure we don't reset the cursor in the case of a dummy event being sent from DockTabWidget to trigger the animation.
Qt::MouseButtons realButtons = QApplication::mouseButtons();
if (QApplication::overrideCursor() && !(realButtons & Qt::LeftButton))
{
QApplication::restoreOverrideCursor();
}
if (m_movingTab && !(mouseEvent->buttons() & Qt::LeftButton))
{
// When a moving tab is released, there is a short animation to put the moving tab
@@ -632,13 +648,7 @@ namespace AzQtComponents
{
QPoint p = tabRect(i).topLeft();
int rightPadding = g_closeButtonPadding;
if (m_overflowing == Overflowing)
{
rightPadding = 0;
}
p.setX(p.x() + tabRect(i).width() - rightPadding - g_closeButtonWidth);
p.setX(p.x() + tabRect(i).width() - g_closeButtonPadding - g_closeButtonWidth);
p.setY(p.y() + 1 + (tabRect(i).height() - g_closeButtonWidth) / 2);
tabBtn->move(p);
}
@@ -203,6 +203,9 @@ namespace AzQtComponents
bool m_movingTab = false;
QPoint m_lastMousePress;
QCursor m_dragCursor;
QCursor m_hoverCursor;
void resetOverflow();
void overflowIfNeeded();
void showCloseButtonAt(int index);
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
</style>
<g id="Cursor-_x2F_-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0.2,0.2-2.2-0.2-2.9c-0.2-0.3-0.6-1-1.7-1C4.3,0.7,3.6,2.2,3.6,3z"/>
</g>
</g>
<path id="Path_1_" class="st0" d="M7.2,7.1V6.2c0-0.4,0.3-1.1,1-1.1s0.9,0.7,0.9,1.2c0,1.5,0,0.4,0,1h0.6c0-2.1,0-0.3,0-0.7
c0-0.6,0.4-1,1-1s1,0.5,1,1.1c0,0.4,0,0.7,0,0.7h0.6V7.1c0-0.5,0.2-0.9,0.8-0.9c0.7,0,0.9,0.5,1,1.3v1v3.8c0,0.5-0.2,1.1-0.4,1.6
l-0.1,0.2l-0.3,0.6L13,15.1l-0.2,0.3l-0.2,0.3L12.4,16c-0.2,0.4-0.3,0.7-0.3,1v0.1V18h-0.9l-0.9-1.9l-1,1.9H5.5v-0.9
c0-0.3-0.3-0.6-0.6-1.1l-0.3-0.3l-0.3-0.3l-0.1-0.1L4,15.1l-0.2-0.2l-0.5-0.5c-0.3-0.3-0.8-0.7-1-1.1L2.1,13L1,10
C0.9,9.8,1,9.5,1.1,9.4c0,0,0,0,0.1-0.1l0.2-0.1C2.2,8.9,3.1,9.3,3.6,10l0.1,0.1l0.8,1.3V3c0-0.5,0.5-1,1-1s0.9,0.5,0.9,0.9
c0,2.7,0,4.1,0,4.2H7.2z"/>
<polygon id="Path_2_" points="11.2,10.5 12.2,10.5 12.2,14.2 11.2,14.2 "/>
<polygon id="Path_3_" points="9.3,10.5 10.3,10.5 10.3,14.2 9.3,14.2 "/>
<polygon id="Path_4_" points="7.4,10.5 8.4,10.5 8.4,14.2 7.4,14.2 "/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 25.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<style type="text/css">
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:none;stroke:#000000;stroke-miterlimit:10;}
.st2{fill-rule:evenodd;clip-rule:evenodd;}
</style>
<path class="st0" d="M7.6,7.1V5.8c0-0.4,0.1-0.7,0.4-1c0.2-0.3,0.6-0.4,0.9-0.4l0,0c0.6,0,1.1,0.3,1.5,0.7l0.1,0.1l0,0l0.1-0.1
c0.3,0,0.5-0.1,0.7-0.1h0.1c0.6,0,1.1,0.3,1.5,0.7L13,5.8l0,0l0.1-0.1c0.2-0.1,0.3-0.2,0.5-0.2h0.1c0.7,0,1.2,0.3,1.6,0.7l0.1,0.1
l0,0l0.1-0.1C15.8,6.1,16,6,16.2,6h0.1c0.6,0,1.1,0.3,1.5,0.7c0.4,0.4,0.6,1,0.6,1.6l0,0V13c0,0.6-0.3,1.6-0.6,2.1
c0,0-1.4,2.1-1.4,2.8l0,0v1.6h-1.8l-0.4-1.4l-0.7,1.4H8.6V18c0-0.7-3-2.7-3-2.7c-0.6-0.4-1-1.3-1-2l0,0V9.7c0-0.7,0.3-1.3,0.7-1.8
C5.9,7.3,6.8,7,7.6,7.1L7.6,7.1z"/>
<path class="st1" d="M7.6,7.1V5.8c0-0.4,0.1-0.7,0.4-1c0.2-0.3,0.6-0.4,0.9-0.4l0,0c0.6,0,1.1,0.3,1.5,0.7l0.1,0.1l0,0l0.1-0.1
c0.3,0,0.5-0.1,0.7-0.1h0.1c0.6,0,1.1,0.3,1.5,0.7L13,5.8l0,0l0.1-0.1c0.2-0.1,0.3-0.2,0.5-0.2h0.1c0.7,0,1.2,0.3,1.6,0.7l0.1,0.1
l0,0l0.1-0.1C15.8,6.1,16,6,16.2,6h0.1c0.6,0,1.1,0.3,1.5,0.7c0.4,0.4,0.6,1,0.6,1.6l0,0V13c0,0.6-0.3,1.6-0.6,2.1
c0,0-1.4,2.1-1.4,2.8l0,0v1.6h-1.8l-0.4-1.4l-0.7,1.4H8.6V18c0-0.7-3-2.7-3-2.7c-0.6-0.4-1-1.3-1-2l0,0V9.7c0-0.7,0.3-1.3,0.7-1.8
C5.9,7.3,6.8,7,7.6,7.1L7.6,7.1z"/>
<polygon class="st2" points="11.1,11 12.1,11 12.1,15 11.1,15 "/>
<polygon class="st2" points="13.1,11 14.1,11 14.1,15 13.1,15 "/>
<polygon class="st2" points="15.1,11 16.1,11 16.1,15 15.1,15 "/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -636,5 +636,7 @@
</qresource>
<qresource prefix="/Cursors">
<file alias="Pointer.svg">img/UI20/Cursors/Pointer.svg</file>
<file alias="Grab_release.svg">img/UI20/Cursors/Grab_release.svg</file>
<file alias="Grabbing.svg">img/UI20/Cursors/Grabbing.svg</file>
</qresource>
</RCC>