-
Notifications
You must be signed in to change notification settings - Fork 85
Add rename local project option #4633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
63ff6a0
b493b90
b832860
634cae0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not the type of dialog we put into
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Either just inline the dialog or make it a private component of that subdirectory |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| import QtQuick | ||
|
|
||
| import "../../components" | ||
| import "../../inputs" | ||
|
|
||
| MMDrawer { | ||
| id: root | ||
|
|
||
| property string errorText: "" | ||
|
|
||
| signal renameClicked( string newName ) | ||
|
|
||
| drawerHeader.title: qsTr( "Rename project" ) | ||
| drawerHeader.titleFont: __style.t2 | ||
|
|
||
| onOpened: { | ||
| root.errorText = "" | ||
| newNameField.text = "" | ||
| } | ||
|
|
||
| drawerContent: Column { | ||
| width: parent.width | ||
| spacing: 0 | ||
|
|
||
| MMTextInput { | ||
| id: newNameField | ||
|
|
||
| width: parent.width | ||
| textFieldBackground.color: root.errorText === "" ? __style.lightGreenColor : __style.negativeUltraLightColor | ||
| textFieldBackground.border.width: root.errorText === "" ? 0 : __style.width2 | ||
| textFieldBackground.border.color: root.errorText === "" ? __style.polarColor : __style.negativeColor | ||
|
|
||
| placeholderText: qsTr( "Enter the new name" ) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Currently this doesn't show at all as we show old name right away |
||
|
|
||
| onTextEdited: root.errorText = "" | ||
| } | ||
|
|
||
| // Fixed-height slot so the drawer does not grow/shrink when the error message appears. | ||
| Item { | ||
| width: parent.width | ||
| height: __style.spacing40 | ||
|
|
||
| Row { | ||
| anchors.verticalCenter: parent.verticalCenter | ||
|
|
||
| width: parent.width | ||
| spacing: __style.margin4 | ||
|
|
||
| visible: root.errorText !== "" | ||
|
|
||
| MMIcon { | ||
| y: parent.height / 2 - height / 2 | ||
| source: __style.errorCircleIcon | ||
| color: __style.negativeColor | ||
| size: __style.icon16 | ||
| } | ||
|
|
||
| MMText { | ||
| width: parent.width - __style.icon16 - parent.spacing | ||
| text: root.errorText | ||
| color: __style.grapeColor | ||
| font: __style.t4 | ||
| verticalAlignment: Text.AlignVCenter | ||
| elide: Text.ElideRight | ||
| } | ||
| } | ||
| } | ||
|
Comment on lines
+48
to
+76
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| MMButton { | ||
| width: parent.width | ||
|
|
||
| text: qsTr( "Confirm" ) | ||
|
|
||
| onClicked: { | ||
| root.renameClicked( newNameField.text ) | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like this approach using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.