refactor: move `PopupMenu` to ui/shared/popups

This commit is contained in:
Pascal Precht 2021-10-14 13:48:03 +02:00 committed by Iuri Matias
parent a78ac5687b
commit fa3adb30e4
17 changed files with 29 additions and 2 deletions

View File

@ -3,9 +3,11 @@ import QtQuick.Controls 2.3
import QtWebEngine 1.9 import QtWebEngine 1.9
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import "../../Chat/ChatColumn/ChatComponents" import "../../Chat/ChatColumn/ChatComponents"
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
property var addNewTab: function () {} property var addNewTab: function () {}

View File

@ -2,10 +2,12 @@ import QtQuick 2.13
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../stores" import "../stores"
import utils 1.0 import utils 1.0
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: downloadMenu id: downloadMenu

View File

@ -2,12 +2,14 @@ import QtQuick 2.13
import QtQuick.Controls 2.3 import QtQuick.Controls 2.3
import QtWebEngine 1.9 import QtWebEngine 1.9
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import "../stores" import "../stores"
import utils 1.0 import utils 1.0
import "../../Chat/ChatColumn/ChatComponents" import "../../Chat/ChatColumn/ChatComponents"
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
property var openInNewTab: function () {} property var openInNewTab: function () {}
property string url property string url

View File

@ -3,6 +3,7 @@ import QtQuick.Controls 2.13
import utils 1.0 import utils 1.0
import "../../../../../shared" import "../../../../../shared"
import "../../../../../shared/popups"
import "../../../../../shared/status" import "../../../../../shared/status"
import ".." import ".."
@ -93,6 +94,7 @@ Item {
id: moreActionsBtn id: moreActionsBtn
onClicked: moreActionsMenu.open() onClicked: moreActionsMenu.open()
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: moreActionsMenu id: moreActionsMenu
x: moreActionsBtn.width - moreActionsMenu.width x: moreActionsBtn.width - moreActionsMenu.width

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
Row { Row {
@ -57,6 +58,7 @@ Row {
} }
} }
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: contactContextMenu id: contactContextMenu
hasArrow: false hasArrow: false

View File

@ -2,10 +2,12 @@ import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13 import QtQuick.Layouts 1.13
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import utils 1.0 import utils 1.0
// TODO: replace with StatusPopupmenu
PopupMenu { PopupMenu {
//% "Fetch Messages" //% "Fetch Messages"
title: qsTrId("fetch-messages") title: qsTrId("fetch-messages")

View File

@ -344,6 +344,7 @@ ModalPopup {
contextMenu.popup(-contextMenu.width / 2 + moreActionsBtn.width / 2, moreActionsBtn.height + 10) contextMenu.popup(-contextMenu.width / 2 + moreActionsBtn.width / 2, moreActionsBtn.height + 10)
} }
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: contextMenu id: contextMenu
Action { Action {

View File

@ -9,6 +9,7 @@ import StatusQ.Popups 0.1
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import "./" import "./"
@ -168,6 +169,7 @@ StatusPopupMenu {
enabled: false enabled: false
} }
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: copyLinkMenu id: copyLinkMenu
//% "Copy link" //% "Copy link"

View File

@ -4,6 +4,7 @@ import QtQuick.Layouts 1.13
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
Rectangle { Rectangle {
@ -94,6 +95,7 @@ Rectangle {
contactContextMenu.popup() contactContextMenu.popup()
} }
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: contactContextMenu id: contactContextMenu
hasArrow: false hasArrow: false

View File

@ -5,6 +5,7 @@ import QtQuick.Layouts 1.13
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
Item { Item {
@ -92,6 +93,7 @@ Item {
onExited: { onExited: {
tokenContainer.hovered = false tokenContainer.hovered = false
} }
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: contextMenu id: contextMenu
Action { Action {

View File

@ -5,6 +5,7 @@ import QtQuick.Layouts 1.13
import utils 1.0 import utils 1.0
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import "../popups" import "../popups"
import "../controls" import "../controls"
@ -156,6 +157,7 @@ Item {
anchors.left: receiveBtn.right anchors.left: receiveBtn.right
anchors.leftMargin: walletMenu.btnOuterMargin anchors.leftMargin: walletMenu.btnOuterMargin
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: newSettingsMenu id: newSettingsMenu
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent

View File

@ -2,9 +2,11 @@ import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import utils 1.0 import utils 1.0
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: newAccountMenu id: newAccountMenu
width: 260 width: 260

View File

@ -2,6 +2,7 @@ import QtQuick 2.13
import QtQuick.Controls 2.13 import QtQuick.Controls 2.13
import StatusQ.Controls 0.1 import StatusQ.Controls 0.1
import "../../../../shared" import "../../../../shared"
import "../../../../shared/popups"
import "../../../../shared/status" import "../../../../shared/status"
import utils 1.0 import utils 1.0
@ -27,6 +28,7 @@ StatusFlatButton {
} }
} }
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: newAccountMenu id: newAccountMenu
width: 260 width: 260

View File

@ -14,6 +14,7 @@ import DotherSide 0.1
import "./app/AppLayouts/Onboarding/views" import "./app/AppLayouts/Onboarding/views"
import "./app" import "./app"
import "./shared" import "./shared"
import "./shared/panels"
import "./shared/popups" import "./shared/popups"
import utils 1.0 import utils 1.0

View File

@ -6,7 +6,9 @@ import QtQml.Models 2.3
import utils 1.0 import utils 1.0
import "status" import "status"
import "./" import "./"
import "./popups"
// TODO: replace with StatusPopupMenu
PopupMenu { PopupMenu {
id: root id: root
width: profileHeader.width width: profileHeader.width

View File

@ -3,7 +3,7 @@ import QtQuick.Controls 2.13
import QtGraphicalEffects 1.13 import QtGraphicalEffects 1.13
import utils 1.0 import utils 1.0
import "../shared" import "../"
Menu { Menu {
// This is to add icons to submenu items. QML doesn't have a way to add icons to those sadly so this is a workaround // This is to add icons to submenu items. QML doesn't have a way to add icons to those sadly so this is a workaround

View File

@ -1,6 +1,5 @@
StyledButton 1.0 StyledButton.qml StyledButton 1.0 StyledButton.qml
RoundedIcon 1.0 RoundedIcon.qml RoundedIcon 1.0 RoundedIcon.qml
PopupMenu 1.0 PopupMenu.qml
Separator 1.0 Separator.qml Separator 1.0 Separator.qml
StatusTabButton 1.0 StatusTabButton.qml StatusTabButton 1.0 StatusTabButton.qml
TextWithLabel 1.0 TextWithLabel.qml TextWithLabel 1.0 TextWithLabel.qml