Warning, /maui/mauikit/demo.6/src/controls/ButtonsPage.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick
0002 import QtQuick.Controls
0003 import QtQuick.Layouts
0004 
0005 import org.mauikit.controls as Maui
0006 
0007 DemoPage
0008 {
0009     id: control
0010     title: i18n("Button")
0011 
0012     Maui.SectionGroup
0013     {
0014         title: control.title
0015         spacing: control.spacing
0016 
0017         DemoSection
0018         {
0019             title: "Buttons"
0020             body: i18n("Different button states: Regular, Checkable and flat. Can also have different layouts")
0021 
0022             Button
0023             {
0024                 icon.name: "folder"
0025                 text: "Button 1"
0026                 onClicked: {}
0027             }
0028 
0029             Button
0030             {
0031                 icon.name: "folder-music"
0032                 text: "Checkable"
0033                 checkable: true
0034                 checked: true
0035                 onClicked:
0036                 {
0037                     root.notify("dialog-info", i18n("Notification #1"), i18n("This is a body message regarding some inportant information about the application state"))
0038 
0039                     root.notify("dialog-info", i18n("Notification #2"), i18n("This is a body message with a custom action"), ()=> { console.log("Notication action") }, i18n("Action"))
0040 
0041                 }
0042             }
0043 
0044             Button
0045             {
0046                 icon.name: "downloads"
0047                 text: "Flat"
0048                 flat: true
0049             }
0050 
0051             Button
0052             {
0053                 display: Button.TextUnderIcon
0054                 icon.name: "folder-downloads"
0055                 text: "Hello"
0056             }
0057 
0058         }
0059 
0060         DemoSection
0061         {
0062             title: i18n("ToolButton")
0063             body: i18n("A common button to be used in tool bars: Regular, Checkable and flat. Can also have different layouts")
0064 
0065 
0066             ToolButton
0067             {
0068                 icon.name: "love"
0069             }
0070 
0071             ToolButton
0072             {
0073                 icon.name: "love"
0074                 checkable: true
0075                 checked: true
0076                 text: "Checkable"
0077 
0078             }
0079 
0080             ToolButton
0081             {
0082                 icon.name: "love"
0083                 display: ToolButton.TextUnderIcon
0084                 text: "Mini"
0085             }
0086 
0087         }
0088 
0089 
0090         DemoSection
0091         {
0092             title: i18n("ToolActions")
0093             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0094             sampleText: 'import org.mauikit.controls as Maui
0095 Maui.ToolActions
0096 {
0097     Action
0098     {
0099         icon.name: "love"
0100     }
0101 
0102     Action
0103     {
0104         icon.name: "love"
0105     }
0106 
0107     Action
0108     {
0109         icon.name: "love"
0110     }
0111 }'
0112             Maui.ToolActions
0113             {
0114                 Action
0115                 {
0116                     icon.name: "love"
0117                 }
0118 
0119                 Action
0120                 {
0121                     icon.name: "love"
0122                 }
0123 
0124                 Action
0125                 {
0126                     icon.name: "love"
0127                 }
0128             }
0129 
0130             Maui.ToolActions
0131             {
0132                 expanded: false
0133                 Action
0134                 {
0135                     icon.name: "love"
0136                 }
0137 
0138                 Action
0139                 {
0140                     icon.name: "love"
0141                 }
0142 
0143                 Action
0144                 {
0145                     icon.name: "love"
0146                     text: i18n("Hidden")
0147                 }
0148             }
0149         }
0150 
0151         DemoSection
0152         {
0153             title: i18n("ToolButtonMenu")
0154             body: i18n("A ToolButton to host menu entries. Menu entries can be defined as Actions or MenuEntries.")
0155             sampleText: 'import org.mauikit.controls as Maui
0156 Maui.ToolButtonMenu
0157 {
0158     icon.name: "overflow-menu"
0159 
0160     MenuItem
0161     {
0162         icon.name: "love"
0163         text: "Menu 1"
0164     }
0165 
0166     MenuItem
0167     {
0168         icon.name: "love"
0169         text: "Menu 2"
0170     }
0171 
0172     MenuItem
0173     {
0174         icon.name: "love"
0175         text: "Menu 3"
0176     }
0177 }'
0178 
0179             Maui.ToolButtonMenu
0180             {
0181                 icon.name: "overflow-menu"
0182                 text: "Menu"
0183 
0184                 MenuItem
0185                 {
0186                     text: "test"
0187                 }
0188             }
0189         }
0190 
0191         DemoSection
0192         {
0193             title: i18n("SpinBox")
0194             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0195             SpinBox
0196             {
0197                 from: 0
0198                 to: 10
0199             }
0200         }
0201 
0202         DemoSection
0203         {
0204             title: i18n("CloseButton")
0205             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0206 
0207             sampleText: 'import org.mauikit.controls as Maui
0208 Maui.CloseButton
0209 {
0210 }'
0211             Maui.CloseButton {}
0212         }
0213 
0214         DemoSection
0215         {
0216             title: i18n("ColorsRow")
0217             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0218 
0219             sampleText: 'import org.mauikit.controls as Maui
0220 Maui.ColorsRow
0221 {
0222     colors: ["blue", "pink", "yellow", "magenta"]
0223 }'
0224 
0225             Maui.ColorsRow
0226             {
0227                 colors: ["blue", "pink", "yellow", "magenta"]
0228             }
0229         }
0230 
0231         DemoSection
0232         {
0233             title: i18n("Chip")
0234             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0235 
0236             sampleText: 'import org.mauikit.controls as Maui
0237 Maui.Chip
0238 {
0239     colors: "pink"
0240     icon.name: "love"
0241     text: "Chip"
0242 }'
0243 
0244             Maui.Chip
0245             {
0246                 text: "A chip"
0247                 icon.name: "folder-gitlab"
0248             }
0249 
0250             Maui.Chip
0251             {
0252                 text: "A chip"
0253                 icon.name: "folder-gitlab"
0254                 color: "pink"
0255             }
0256 
0257             Maui.Chip
0258             {
0259                 text: "A chip"
0260                 icon.name: "folder-gitlab"
0261                 color: "orange"
0262             }
0263 
0264         }
0265 
0266         DemoSection
0267         {
0268             title: i18n("Switch")
0269             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0270 
0271             Switch
0272             {
0273                 text: "Switch"
0274                 icon.name: "contrast"
0275             }
0276 
0277             Switch
0278             {
0279                 icon.name: "anchor"
0280             }
0281 
0282             Switch
0283             {
0284                 checked: true
0285             }
0286         }
0287 
0288         DemoSection
0289         {
0290             title: i18n("Checkbox")
0291             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0292 
0293             CheckBox
0294             {
0295                 text: "CheckBox"
0296             }
0297 
0298             CheckBox
0299             {
0300                 autoExclusive: true
0301                 text: "Autoexclusive"
0302             }
0303 
0304             CheckBox
0305             {
0306                 icon.name: "anchor"
0307                 text: "CheckBox"
0308             }
0309         }
0310 
0311 
0312         DemoSection
0313         {
0314             title: i18n("RadioButton")
0315             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0316 
0317             RadioButton
0318             {
0319                 text: "RadioButton"
0320             }
0321         }
0322 
0323         DemoSection
0324         {
0325             title: i18n("FloatingButton")
0326             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0327             sampleText: 'import org.mauikit.controls as Maui
0328 Maui.FloatingButton
0329 {
0330     icon.name: "list-add"
0331     anchors.bottom: parent.bottom
0332     anchors.right: parent.right
0333     anchors.margins: Maui.style.space.big
0334 }'
0335 
0336             column: Pane
0337             {
0338                 implicitHeight: 300
0339                 Layout.fillWidth: true
0340 
0341                 Maui.FloatingButton
0342                 {
0343                     icon.name: "list-add"
0344                     anchors.bottom: parent.bottom
0345                     anchors.right: parent.right
0346                     anchors.margins: Maui.Style.space.big
0347                 }
0348             }
0349         }
0350 
0351         DemoSection
0352         {
0353             title: i18n("PieButton")
0354             body: i18n("MauiKit control for joint action buttons. Can be collapsed and have hidden actions too.")
0355             sampleText: 'import org.mauikit.controls as Maui
0356 Maui.FloatingButton
0357 {
0358     icon.name: "list-add"
0359     anchors.bottom: parent.bottom
0360     anchors.right: parent.right
0361     anchors.margins: Maui.style.space.big
0362 }'
0363 
0364             column: Pane
0365             {
0366                 implicitHeight: 300
0367                 Layout.fillWidth: true
0368 
0369                 Maui.PieButton
0370                 {
0371                     icon.name: "go-previous"
0372                     anchors.bottom: parent.bottom
0373                     anchors.right: parent.right
0374                     anchors.margins: Maui.Style.space.big
0375 
0376                     Action
0377                     {
0378                         icon.name: "list-add"
0379                     }
0380 
0381                     Action
0382                     {
0383                         icon.name: "love"
0384                     }
0385 
0386                     Action
0387                     {
0388                         icon.name: "view-list-icons"
0389                     }
0390                 }
0391             }
0392         }
0393     }
0394 }