Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Unmaintained
KDE Workspace
Commits
b45eada2
Commit
b45eada2
authored
Sep 14, 2012
by
Ralf Jung
Browse files
plasmaclock: Fix calendar resizing
BUG: 306762 FIXED-IN: 4.9.2 REVIEW: 106441
parent
6d098c60
Changes
1
Hide whitespace changes
Inline
Side-by-side
libs/plasmaclock/calendar.cpp
View file @
b45eada2
...
...
@@ -360,35 +360,30 @@ void Calendar::configAccepted(KConfigGroup cg)
void
Calendar
::
resizeEvent
(
QGraphicsSceneResizeEvent
*
event
)
{
Q_UNUSED
(
event
);
if
(
d
->
calendarTable
)
{
if
(
isDisplayingDateDetails
())
{
d
->
calendarTable
->
setMaximumWidth
(
size
().
width
()
/
2
);
}
else
{
d
->
calendarTable
->
setMaximumWidth
(
-
1
);
}
}
// just forward the event. Not removed due to BC.
QGraphicsWidget
::
resizeEvent
(
event
);
}
void
CalendarPrivate
::
updatePreferredSize
()
void
CalendarPrivate
::
updatePreferredSize
()
// don't rename function in stable branch
{
QSize
size
=
calendarTable
?
calendarTable
->
size
().
toSize
()
:
QSize
(
250
,
250
);
QSize
minSize
=
QSize
(
200
,
200
);
QSize
prefSize
=
calendarTable
?
calendarTable
->
size
().
toSize
()
:
QSize
(
250
,
250
);
if
(
q
->
isDisplayingDateDetails
())
{
// our seperators width
s
is the vertical line + space for the vertical scrollbar + spacing
// our seperator
'
s width is the vertical line + space for the vertical scrollbar + spacing
const
int
sepWidth
=
(
separator
?
separator
->
size
().
width
()
:
6
)
+
24
;
size
.
setWidth
(
size
.
width
()
*
2
+
sepWidth
*
2
);
prefSize
.
setWidth
(
prefSize
.
width
()
*
2
+
sepWidth
*
2
);
minSize
.
setWidth
(
minSize
.
width
()
*
2
);
// should be enough even for the separator
}
q
->
setPreferredSize
(
size
);
q
->
setMinimumSize
(
minSize
);
q
->
setPreferredSize
(
prefSize
);
}
void
Calendar
::
applyConfiguration
(
KConfigGroup
cg
)
{
const
bool
details
=
isDisplayingDateDetails
();
calendarTable
()
->
applyConfiguration
(
cg
);
if
(
details
!=
isDisplayingDateDetails
())
{
d
->
updatePreferredSize
();
}
d
->
updatePreferredSize
();
d
->
displayEvents
();
}
void
Calendar
::
manualDateChange
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment