Skip to content

Commit

Permalink
temporary commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongYic00 committed Nov 21, 2022
1 parent be336fa commit 8436676
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/resources/dtk/Pane.qml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ T.Pane {
padding: radius

background: Rectangle {
height: control.height
width: control.width
radius: control.radius
color: DPalette.itemBackground
}
Expand Down
44 changes: 41 additions & 3 deletions src/resources/dtk/TabButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,57 @@ T.TabButton {
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
width: contentItem.implicitWidth + leftPadding + rightPadding

width: contentItem.implicitWidth + leftPadding + rightPadding
horizontalPadding: smallRadius
verticalPadding: smallRadius / 2
Component.onCompleted: width = Math.min(width, 120)
Component.onCompleted: {
console.warn('tabbutton', width, implicitBackgroundWidth,
implicitContentWidth, implicitWidth, leftPadding)
width = Math.min(width, 120)
}

icon.width: 24
icon.height: 24
icon.color: control.checked
|| control.highlighted ? DPalette.highlightedText : control.flat
&& !control.down ? (control.visualFocus ? DPalette.highlight : DPalette.windowText) : control.down ? DPalette.highlight : DPalette.buttonText

contentItem: IconLabel {
contentItem:
/*Item {
implicitWidth: 80
implicitHeight: Math.max(textlabel.implicitHeight,
iconimg.implicitHeight)
clip: true
Component.onCompleted: console.warn('row', width, height,
implicitHeight)
IconImage {
id: iconimg
anchors.verticalCenter: parent.verticalCenter
source: icon.source
name: icon.name
width: icon.width
height: icon.height
color: icon.color
visible: source.length || name.length
}
Text {
id: textlabel
anchors.left: iconimg.right
anchors.right: parent.right
Component.onCompleted: console.warn('text', width, height,
implicitHeight)
text: control.text
elide: Text.ElideRight
font.pixelSize: bigRadius
color: control.checked
|| control.highlighted ? DPalette.highlightedText : control.flat
&& !control.down ? (control.visualFocus ? DPalette.highlight : DPalette.windowText) : control.down ? DPalette.highlight : DPalette.buttonText
}
ToolTip.visible: textlabel.truncated && hovered
ToolTip.text: text
}*/
IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
Expand Down

0 comments on commit 8436676

Please sign in to comment.