@ -127,7 +127,7 @@ MouseArea {
target: contentItem
height: timeLabel . height + ( main . showDate || timezoneLabel . visible ? 0.8 * timeLabel.height : 0 )
width: Math . max ( timeLabel . paintedW idth + ( main . showDate ? timezoneLabel.paintedWidth : 0 ) ,
width: Math . max ( timeLabel . w idth + ( main . showDate ? timezoneLabel.paintedWidth : 0 ) ,
timezoneLabel . paintedWidth , dateLabel . paintedWidth ) + PlasmaCore . Units . smallSpacing * 2
}
@ -149,7 +149,7 @@ MouseArea {
height: sizehelper . height
width: sizehelper . contentWidth
font.pixelSize: timeLabel . heigh t
fontSizeMode: Text . VerticalFi t
}
PropertyChanges {
@ -158,7 +158,8 @@ MouseArea {
height: main . showDate ? 0.7 * timeLabel.height : 0.8 * timeLabel . height
width: main . showDate ? timezoneLabel.paintedWidth : timeLabel . width
font.pixelSize: timezoneLabel . height
font.pointSize: main . showDate ? 0.7 * timeLabel.font.pointSize : 0.8 * timeLabel . font . pointSize
fontSizeMode: main . showDate ? Text.VerticalFit : Text . Fit
}
PropertyChanges {
@ -168,7 +169,9 @@ MouseArea {
width: dateLabel . paintedWidth
verticalAlignment: Text . AlignVCenter
font.pixelSize: dateLabel . height
font.pointSize: 0.8 * timeLabel . font . pointSize
font.pixelSize: - 1
fontSizeMode: Text . VerticalFit
}
AnchorChanges {
@ -189,9 +192,9 @@ MouseArea {
* and still fits well into the panel with all the applied margins .
* /
height: Math . min ( main . showDate || timezoneLabel . visible ? main . height * 0.56 : main . height * 0.71 ,
3 * PlasmaCore . Theme . defaultFont . pixelSize )
Plasmoid . configuration . autoFontAndSize ? 3 * PlasmaCore.Theme.defaultFont.pixelSize : 1024 )
font.pixelSize: sizehelper . heigh t
fontSizeMode: Text . VerticalFi t
}
} ,
@ -222,16 +225,36 @@ MouseArea {
anchors.right: contentItem . right
}
PropertyChanges {
target: timeLabel
height: sizehelper . height
width: sizehelper . contentWidth
fontSizeMode: Text . VerticalFit
}
PropertyChanges {
target: timezoneLabel
height: 0.7 * timeLabel . height
width: timezoneLabel . paintedWidth
font.pointSize: 0.7 * timeLabel . font . pointSize
fontSizeMode: Text . VerticalFit
}
PropertyChanges {
target: dateLabel
height: timeLabel . height
width: dateLabel . paintedWidth + PlasmaCore . Units . smallSpacing
font.pixelSize: 1024
verticalAlignment: Text . AlignVCenter
anchors.rightMargin: labelsGrid . columnSpacing
font.pointSize: timeLabel . font . pointSize
font.pixelSize: - 1
fontSizeMode: Text . VerticalFit
}
@ -242,32 +265,12 @@ MouseArea {
anchors.verticalCenter: labelsGrid . verticalCenter
}
PropertyChanges {
target: timeLabel
height: sizehelper . height
width: sizehelper . contentWidth
fontSizeMode: Text . VerticalFit
}
PropertyChanges {
target: timezoneLabel
height: 0.7 * timeLabel . height
width: timezoneLabel . paintedWidth
fontSizeMode: Text . VerticalFit
horizontalAlignment: Text . AlignHCenter
}
PropertyChanges {
target: sizehelper
height: Math . min ( main . height , 3 * PlasmaCore . Theme . defaultFont . pixelSize )
height: Math . min ( main . height , Plasmoid . configuration . autoFontAndSize ? 3 * PlasmaCore.Theme.defaultFont.pixelSize : 1024 )
fontSizeMode: Text . VerticalFit
font.pixelSize: 3 * PlasmaCore . Theme . defaultFont . pixelSize
}
} ,
@ -302,18 +305,17 @@ MouseArea {
height: sizehelper . contentHeight
width: main . width
font.pixelSize: Math . min ( timeLabel . height , 3 * PlasmaCore . Theme . defaultFont . pixelSize )
fontSizeMode: Text . HorizontalFit
fontSizeMode: Text . VerticalFit
}
PropertyChanges {
target: timezoneLabel
height: Math . max ( 0.7 * timeLabel . height , minimumPixelSize )
height: 0.7 * timeLabel . height
width: main . width
font.pointSize: 0.7 * timeLabel . font . pointSize
fontSizeMode: Text . Fit
minimumPixelSize: dateLabel . minimumPixelSize
elide: Text . ElideRight
}
@ -328,7 +330,8 @@ MouseArea {
verticalAlignment: Text . AlignTop
/ / T h o s e m a g i c n u m b e r s a r e p u r e l y w h a t l o o k s n i c e a s m a x i m u m s i z e , h e r e w e h a v e i t t h e s m a l l e s t
/ / b e t w e e n s l i g h t l y b i g g e r t h a n t h e d e f a u l t f o n t ( 1 . 4 t i m e s ) a n d a b i t s m a l l e r t h a n t h e t i m e f o n t
font.pixelSize: Math . min ( 0.7 * timeLabel . height , PlasmaCore . Theme . defaultFont . pixelSize * 1.4 )
font.pixelSize: Math . min ( 0.7 * timeLabel . height , Plasmoid . configuration . autoFontAndSize ? PlasmaCore . Theme . defaultFont . pixelSize * 1.4 : 1024 )
font.pointSize: - 1
elide: Text . ElideRight
wrapMode: Text . WordWrap
}
@ -343,10 +346,10 @@ MouseArea {
PropertyChanges {
target: sizehelper
height: Plasmoid . configuration . autoFontAndSize ? 3 * PlasmaCore.Theme.defaultFont.pixelSize : 1024
width: main . width
fontSizeMode: Text . HorizontalFit
font.pixelSize: 3 * PlasmaCore . Theme . defaultFont . pixelSize
fontSizeMode: Text . Fit
}
} ,
@ -390,20 +393,20 @@ MouseArea {
height: 0.7 * timeLabel . height
width: main . width
font.pointSize: 0.7 * timeLabel . font . pointSize
fontSizeMode: Text . Fit
minimumPixelSize: 1
}
PropertyChanges {
target: dateLabel
height: 0.7 * timeLabel . height
font.pixelSize: 1024
width: Math . max ( timeLabel . contentWidth , PlasmaCore . Units . gridUnit * 3 )
verticalAlignment: Text . AlignVCenter
font.pointSize: 0.7 * timeLabel . font . pointSize
font.pixelSize: - 1
fontSizeMode: Text . Fit
minimumPixelSize: 1
wrapMode: Text . WordWrap
}
@ -431,7 +434,6 @@ MouseArea {
width: main . width
fontSizeMode: Text . Fit
font.pixelSize: 1024
}
}
]
@ -493,30 +495,27 @@ MouseArea {
Components . Label {
id: timeLabel
font {
family: Plasmoid . configuration . fontFamily || PlasmaCore . Theme . defaultFont . family
weight: Plasmoid . configuration . boldText ? Font.Bold : PlasmaCore . Theme . defaultFont . weight
italic: Plasmoid . configuration . italicText
pixelSize: 1024
pointSize: - 1 / / B e c a u s e w e ' r e s e t t i n g t h e p i x e l s i z e i n s t e a d
/ / T O D O : r e m o v e o n c e t h i s l a b e l i s p o r t e d t o P C 3
}
font.family: Plasmoid . configuration . autoFontAndSize ? PlasmaCore.Theme.defaultFont.family : Plasmoid . configuration . fontFamily
font.weight: Plasmoid . configuration . autoFontAndSize ? PlasmaCore.Theme.defaultFont.weight : Plasmoid . configuration . fontWeight
font.italic: Plasmoid . configuration . autoFontAndSize ? PlasmaCore.Theme.defaultFont.italic : Plasmoid . configuration . italicText
font.pointSize: Plasmoid . configuration . autoFontAndSize ? 1024 : Plasmoid . configuration . fontSize
minimumPointSize: 1
minimumPixelSize: 1
text: Qt . formatTime ( main . getCurrentTime ( ) , main . timeFormat )
verticalAlignment: Text . AlignVCenter
horizontalAlignment: Text . AlignHCenter
verticalAlignment: Text . AlignVCenter
}
Components . Label {
id: timezoneLabel
font.family: timeLabel . font . family
font.weight: timeLabel . font . weight
font.italic: timeLabel . font . italic
font.pixelSize: 1024
font.pointSize: - 1 / / B e c a u s e w e ' r e s e t t i n g t h e p i x e l s i z e i n s t e a d
/ / T O D O : r e m o v e o n c e t h i s l a b e l i s p o r t e d t o P C 3
font.pointSize: timeLabel . font . pointSize
minimumPointSize: 1
minimumPixelSize: 1
visible: text . length > 0
@ -533,9 +532,8 @@ MouseArea {
font.family: timeLabel . font . family
font.weight: timeLabel . font . weight
font.italic: timeLabel . font . italic
font.pixelSize: 1024
font.pointSize: - 1 / / B e c a u s e w e ' r e s e t t i n g t h e p i x e l s i z e i n s t e a d
/ / T O D O : r e m o v e o n c e t h i s l a b e l i s p o r t e d t o P C 3
font.pointSize: timeLabel . font . pointSize
minimumPointSize: 1
minimumPixelSize: 1
horizontalAlignment: Text . AlignHCenter
@ -553,7 +551,9 @@ MouseArea {
font.family: timeLabel . font . family
font.weight: timeLabel . font . weight
font.italic: timeLabel . font . italic
minimumPixelSize: 1
font.pointSize: timeLabel . font . pointSize
minimumPointSize: timeLabel . minimumPointSize
minimumPixelSize: timeLabel . minimumPixelSize
visible: false
}
@ -564,6 +564,7 @@ MouseArea {
font.family: timeLabel . font . family
font.weight: timeLabel . font . weight
font.italic: timeLabel . font . italic
font.pointSize: timeLabel . font . pointSize
}
/ / Q t ' s Q L o c a l e d o e s n o t o f f e r a n y m o d u l a r t i m e c r e a t i n g l i k e K l o c a l e d i d