diff --git a/src/InfoData.h b/src/InfoData.h --- a/src/InfoData.h +++ b/src/InfoData.h @@ -12,6 +12,7 @@ Q_PROPERTY(QString component READ component WRITE setComponent NOTIFY componentChanged) Q_PROPERTY(QString higUrl READ higUrl NOTIFY higUrlChanged) Q_PROPERTY(QString sourceUrl READ sourceUrl NOTIFY sourceUrlChanged) + Q_PROPERTY(QString apiUrl READ apiUrl NOTIFY apiUrlChanged) Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(QString text READ text NOTIFY textChanged) @@ -21,6 +22,7 @@ QString component() const; QString higUrl() const; QString sourceUrl() const; + QString apiUrl() const; QString title() const; QString text() const; @@ -30,6 +32,7 @@ void componentChanged(); void higUrlChanged(); void sourceUrlChanged(); + void apiUrlChanged(); void titleChanged(); void textChanged(); @@ -40,6 +43,7 @@ QString m_component; QString m_higUrl; QString m_sourceUrl; + QString m_apiUrl; QString m_title; QString m_text; QVariantMap m_jsonMap; diff --git a/src/InfoData.cpp b/src/InfoData.cpp --- a/src/InfoData.cpp +++ b/src/InfoData.cpp @@ -40,6 +40,11 @@ return m_sourceUrl; } +QString InfoData::apiUrl() const +{ + return m_apiUrl; +} + QString InfoData::title() const { return m_title; @@ -63,6 +68,7 @@ { m_sourceUrl = QString(); m_higUrl = QString(); + m_apiUrl = QString(); m_title = QString(); m_text = QString(); } @@ -76,6 +82,8 @@ sourceUrlChanged(); m_higUrl = componentVariant.contains("higUrl") ? componentVariant["higUrl"].toString() : QString(); higUrlChanged(); + m_apiUrl = componentVariant.contains("apiUrl") ? componentVariant["apiUrl"].toString() : QString(); + apiUrlChanged(); m_title = componentVariant.contains("title") ? componentVariant["title"].toString() : QString(); titleChanged(); m_text = componentVariant.contains("text") ? componentVariant["text"].toString() : QString(); diff --git a/src/data/contents/ui/gallery/components/InfoSheet.qml b/src/data/contents/ui/gallery/components/InfoSheet.qml --- a/src/data/contents/ui/gallery/components/InfoSheet.qml +++ b/src/data/contents/ui/gallery/components/InfoSheet.qml @@ -28,6 +28,7 @@ property Kirigami.Page page property url higUrl: infoData.higUrl property url sourceUrl: infoData.sourceUrl + property url apiUrl: infoData.apiUrl property alias title: titleLabel.text property alias text: mainText.text property alias component: infoData.component @@ -58,6 +59,11 @@ enabled: sourceUrl != "" onClicked: Qt.openUrlExternally(sourceUrl) } + Controls.ToolButton { + text: qsTr("API...") + enabled: apiUrl != "" + onClicked: Qt.openUrlExternally(apiUrl) + } } Controls.Label { diff --git a/src/data/info-data.json b/src/data/info-data.json --- a/src/data/info-data.json +++ b/src/data/info-data.json @@ -2,7 +2,8 @@ "FormLayoutGallery": { "title":"Form Layout", "higUrl": "https://hig.kde.org/patterns/content/form.html", - "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/FormLayoutGallery.qml", + "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/FormLayoutGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1FormLayout.html", "text": "

A Form layout is used to help align and structure a layout containing many control and input fields


When to use


" }, "SelectionControlsGallery" : { @@ -15,31 +16,37 @@ "title": "Cards Layout", "higUrl": "https://hig.kde.org/components/editing/card.html", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/CardsLayoutGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1CardsLayout.html", "text": "The Kirigami types AbstractCard and Card are used to implement the popular Card pattern used on many mobile and web platforms that is used to display a collection of information or actions.
Besides the Card components, Kirigami offers also 3 kinds of views and positioners to help to present cards with beautiful and responsive layouts.

In this page, CardsLayout is presented, which should be used when the cards are not instantiated by a model or by a model which has always very few items (In the case of a big model CardsListView or CardsGridview should be used instead). They are presented as a grid of two columns which will remain centered if the application is really wide, or become a single column if there is not enough space for two columns, such as a mobile phone screen.
A CardsLayout should always be contained within a ColumnLayout." }, "DrawerGallery": { "title": "Drawers", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/DrawerGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1OverlayDrawer.html", "text": "Drawers are bars anchored to an edge of the screen: left, right, top or bottom.
On the left edge they should contain controls and settings global for the whole app, and is strongly encouraged to use the default component GlobalDrawer and to have only one instance for the whole application.
On the right edge they should have context-dependent actions linked to the current Page. It is strongly suggested to use the default component ContextDrawer for this and to have only one instance for the whole application.
Drawers can be modal(default) in which they block input in the rest of the application window, clicking on a darkened out area will dismiss the drawer.
Non modal drawers will leave the rest of the application window functional and vertical(left and right edge) drawers will become sidebars.
Non modal drawers can also be collapsible, switching from a full vertical sidebar to a more compact vertical toolbar.
You can test between different Drawer modes in the \"Global Drawer Mode...\" menu entry in the global drawer of this application running on Desktop systems." }, "OverlaySheetGallery": { "title": "Overlay Sheets", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/OverlaySheetGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1OverlaySheet.html", "text": "The OverlaySheet control is a kind of modal content which goes over the main application content (either just the page or the whole app area) which is supposed to be used to display long contents, which may be taller than the application window itself, in which case the content will be scrollable.
The visual metaphore of the control is a piece of paper that scrolling, covering the page of the application, which can be dismissed scrolling it away (or tapping any area outside it)." }, "CardsListViewGallery": { "title": "Cards List View", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/CardsListViewGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1CardsListView.html", "text": "The Kirigami types AbstractCard and Card are used to implement the popular Card pattern used on many mobile and web platforms that is used to display a collection of information or actions.
Besides the Card components, Kirigami offers also 3 kinds of views and positioners to help to present cards with beautiful and responsive layouts.

In this page, CardsListView is used to do a list view of AbstractCard subclasses with a custom layout inside.
CardsListView should be used only with cards which can look good at any horizontal size, so it is recommended to use directly AbstractCard with an appropriate layout inside, because they are stretching for the whole list width.
Therefore is discouraged to use it with the Card type, unless it has Horizontal as headerOrientation.
The choice between using this view with AbstractCard or a normal ListView with AbstractListItem/BasicListItem is purely a choice based on aesthetics alone." }, "CardsGridViewGallery" : { "title": "Cards Grid View", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/CardsGridViewGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1CardsGridView.html", "text": "The Kirigami types AbstractCard and Card are used to implement the popular Card pattern used on many mobile and web platforms that is used to display a collection of information or actions.
Besides the Card components, Kirigami offers also 3 kinds of views and positioners to help to present cards with beautiful and responsive layouts.

In this page, CardsGridView shows an example on how to put cards in a grid view, generated by a Qt model.
The behavior is same as CardsLayout, and it allows cards to be put in one or two columns depending from the available width.
CardsGridView has the limitation that every Card must have the same exact height, so cellHeight must be manually set to a value in which the content fits for every item.
If possible use cards only when you don't need to instantiate that many and use CardsLayout instead." }, "InlineMessagesGallery" : { "title": "Inline Messages", "sourceUrl": "https://cgit.kde.org/kirigami-gallery.git/tree/src/data/contents/ui/gallery/InlineMessagesGallery.qml", + "apiUrl": "https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1InlineMessage.html", "text": "Inline messages allow you to show various types of messages placed the same layout as content they relate to, instead of showing a message in an overlay. They are invisible by default and need to be explicitly set visible to be revealed." } }