Skip to content

Commit

Permalink
Merge pull request #92 from Esri/uvi10859-addPortalButton#89
Browse files Browse the repository at this point in the history
Add portal button #89
  • Loading branch information
uabeysinghe authored Sep 29, 2021
2 parents 3c47487 + 666ca81 commit 292fb66
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 25 deletions.
6 changes: 3 additions & 3 deletions AppMetrics/FeedbackDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Dialog {

background: Rectangle {
anchors.fill: parent
color: Singletons.Config.buttonStates(control, "major")
color: Singletons.Config.buttonStates(cancelFeedbackBtn, "major")
radius: app.info.properties.mainButtonRadius
border.width: app.info.properties.mainButtonBorderWidth
border.color: app.info.properties.mainButtonBorderColor
Expand Down Expand Up @@ -221,9 +221,9 @@ Dialog {

background: Rectangle {
anchors.fill: parent
color: Singletons.Config.buttonStates(control)
color: Singletons.Config.buttonStates(sendFeedbackBtn)
radius: app.info.properties.mainButtonRadius
border.width: control.enabled ? app.info.properties.mainButtonBorderWidth : 0
border.width: sendFeedbackBtn.enabled ? app.info.properties.mainButtonBorderWidth : 0
border.color: app.info.properties.mainButtonBorderColor
}

Expand Down
6 changes: 3 additions & 3 deletions AppMetrics/UpdatesDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Dialog {

delegate: Rectangle {
height: 50 * AppFramework.displayScaleFactor
width: parent.width
width: ListView.view.width

ColumnLayout {
anchors.fill: parent
Expand Down Expand Up @@ -171,9 +171,9 @@ Dialog {
enabled: true
background: Rectangle {
anchors.fill: parent
color: Singletons.Config.buttonStates(control)
color: Singletons.Config.buttonStates(closeDialogBtn)
radius: app.info.properties.mainButtonRadius
border.width: control.enabled ? app.info.properties.mainButtonBorderWidth : 0
border.width: closeDialogBtn.enabled ? app.info.properties.mainButtonBorderWidth : 0
border.color: app.info.properties.mainButtonBorderColor
}

Expand Down
13 changes: 6 additions & 7 deletions Controls/StyledButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import QtGraphicalEffects 1.12
import ArcGIS.AppFramework 1.0

Button {
id: button
id: control

property string iconSource
property real textPointSize: 13

property color backgroundColor: "#fefefe"
Expand All @@ -46,7 +47,7 @@ Button {
property int radius: height / 2
property int labelSpacing: 5 * AppFramework.displayScaleFactor

readonly property alias progress: button.__progress
readonly property alias progress: control.__progress
property real __progress: 0.0

property string fontFamily
Expand All @@ -68,9 +69,7 @@ Button {

onProgressChanged: {
if (__progress === 1.0) {
if (activeFocusOnPress) {
forceActiveFocus();
}
forceActiveFocus();
checked = true;
activated();
}
Expand Down Expand Up @@ -174,7 +173,7 @@ Button {
background: Rectangle {
implicitWidth: 110

radius: button.radius
radius: control.radius

color: control.enabled
? control.pressed
Expand All @@ -197,7 +196,7 @@ Button {
}

radius: parent.radius
width: parent.width * button.progress
width: parent.width * control.progress

color: activateColor
visible: activateDelay > 0 && progress > 0 && width > radius * 2
Expand Down
14 changes: 10 additions & 4 deletions Controls/StyledSwitch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@
import QtQuick 2.15
import QtQuick.Controls 2.15

import ArcGIS.AppFramework 1.0

Switch {
id: control

property color disabledColor: "grey"
property color uncheckedColor: "red"
property color checkedColor: "green"

indicator: Rectangle {
id: rect

property color shadow: control.checked ? Qt.darker(highlight, 1.2): "#999"
property color bg: control.checked ? highlight : uncheckedColor
property color highlight: control.enabled ? checkedColor : disabledColor

implicitWidth: Math.round(implicitHeight * 3)
implicitHeight: Math.max(16, Math.round(TextSingleton.implicitHeight))
implicitHeight: 24 * AppFramework.displayScaleFactor

border.color: "gray"
color: "red"
Expand All @@ -37,9 +43,9 @@ Switch {
Behavior on shadow {ColorAnimation{ duration: 80 }}
Behavior on bg {ColorAnimation{ duration: 80 }}
gradient: Gradient {
GradientStop {color: shadow; position: 0}
GradientStop {color: bg ; position: 0.2}
GradientStop {color: bg ; position: 1}
GradientStop {color: rect.shadow; position: 0}
GradientStop {color: rect.bg ; position: 0.2}
GradientStop {color: rect.bg ; position: 1}
}
Rectangle {
color: "#44ffffff"
Expand Down
3 changes: 1 addition & 2 deletions appinfo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"appLink": "",
"arcgisRuntime": 0,
"capabilities": {
"audio": false,
"backgroundModes": {
Expand Down Expand Up @@ -123,6 +122,6 @@
"version": {
"major": 1,
"micro": 1,
"minor": 4
"minor": 5
}
}
15 changes: 9 additions & 6 deletions iteminfo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"access": "org",
"accessInformation": null,
"advancedSettings": null,
"appCategories": [
],
"avgRating": 0,
Expand All @@ -10,7 +11,7 @@
"commentsEnabled": true,
"created": 1481688674000,
"culture": "en-au",
"description": "<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body style=\" font-family:'Avenir Next LT Pro'; font-size:14.5pt; font-weight:400; font-style:normal;\">\n<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Tile package creation tool.</p></body></html>",
"description": "\n<p style=' margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;'>Tile package creation tool.</p>",
"documentation": null,
"extent": [
],
Expand All @@ -19,17 +20,18 @@
"id": "561a8441825441349a3b1ad23fdaea75",
"industries": [
],
"isOrgItem": true,
"itemControl": "admin",
"languages": [
],
"largeThumbnail": null,
"licenseInfo": "",
"licenseInfo": "\n<p style='-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;'><br /></p>",
"listed": false,
"modified": 1529977877000,
"modified": 1632811420000,
"name": "561a8441825441349a3b1ad23fdaea75.zip",
"numComments": 67,
"numComments": 70,
"numRatings": 0,
"numViews": 365,
"numViews": 498,
"owner": "appstudio_apps",
"ownerFolder": null,
"properties": null,
Expand All @@ -38,9 +40,10 @@
"scoreCompleteness": 65,
"screenshots": [
],
"size": 859236,
"size": 988385,
"snippet": "Tile package creation tool.",
"spatialReference": null,
"subInfo": 0,
"tags": [
],
"thumbnail": "thumbnail/thumbnail.png",
Expand Down

0 comments on commit 292fb66

Please sign in to comment.