Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions chameleon/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ set(QML_FILES
RadioButton.qml
RoundButton.qml
ScrollBar.qml
ScrollView.qml
ScrollIndicator.qml
Slider.qml
SpinBox.qml
Expand Down
10 changes: 10 additions & 0 deletions chameleon/ScrollView.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import org.deepin.dtk 1.0 as D

D.ScrollView {

}

1 change: 1 addition & 0 deletions chameleon/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<file>RadioButton.qml</file>
<file>RoundButton.qml</file>
<file>ScrollBar.qml</file>
<file>ScrollView.qml</file>
<file>ScrollIndicator.qml</file>
<file>Slider.qml</file>
<file>SpinBox.qml</file>
Expand Down
1 change: 1 addition & 0 deletions qmlplugin/qmlplugin_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ void QmlpluginPlugin::registerTypes(const char *uri)
dtkRegisterType(uri, controlsUri, 1, 0, "ScrollIndicator");
dtkRegisterType(uri, controlsUri, 1, 0, "Popup");
dtkRegisterType(uri, controlsUri, 1, 0, "ScrollBar");
dtkRegisterType(uri, controlsUri, 1, 0, "ScrollView");
// DTK Controls
dtkRegisterType(uri, controlsUri, 1, 0, "LineEdit");
dtkRegisterType(uri, controlsUri, 1, 0, "SearchEdit");
Expand Down
28 changes: 26 additions & 2 deletions qt6/src/qml/ScrollView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,32 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

import QtQuick.Controls
import QtQuick
import QtQuick.Controls.impl
import QtQuick.Templates as T
import org.deepin.dtk 1.0 as D

ScrollView {
T.ScrollView {
id: control

implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)

D.ScrollBar.vertical: D.ScrollBar {
parent: control
x: control.mirrored ? 0 : control.width - width
y: control.topPadding
height: control.availableHeight
active: control.D.ScrollBar.horizontal.active
}

D.ScrollBar.horizontal: D.ScrollBar {
parent: control
x: control.leftPadding
y: control.height - height
width: control.availableWidth
active: control.D.ScrollBar.vertical.active
}
}
10 changes: 7 additions & 3 deletions qt6/src/qml/TextArea.qml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ T.TextArea {

property D.Palette placeholderTextPalette: DS.Style.edit.placeholderText
placeholderTextColor: D.ColorSelector.placeholderTextPalette
implicitWidth: Math.max(DS.Style.control.implicitWidth(control), placeholder.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(DS.Style.control.implicitHeight(control), placeholder.implicitHeight + topPadding + bottomPadding)

implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
implicitBackgroundWidth + leftInset + rightInset,
placeholder.implicitWidth + leftPadding + rightPadding)
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
implicitBackgroundHeight + topInset + bottomInset,
placeholder.implicitHeight + topPadding + bottomPadding)

padding: DS.Style.control.padding

color: palette.text
Expand Down