|
Lines 828-835
void PanelView::pinchContainment(const Q
Link Here
|
| 828 |
lastSize.writeEntry("max", m_lastMax); |
828 |
lastSize.writeEntry("max", m_lastMax); |
| 829 |
configNeedsSaving(); |
829 |
configNeedsSaving(); |
| 830 |
|
830 |
|
| 831 |
const QString last = horizontal ? "Horizontal" + QString::number(sw) : |
831 |
QString last = (horizontal ? "Horizontal" : "Vertical") + |
| 832 |
"Vertical" + QString::number(sh); |
832 |
QString::number(horizontal ? sw : sh); |
| 833 |
if (sizes.hasGroup(last)) { |
833 |
if (sizes.hasGroup(last)) { |
| 834 |
KConfigGroup thisSize(&sizes, last); |
834 |
KConfigGroup thisSize(&sizes, last); |
| 835 |
|
835 |
|
|
Lines 850-856
void PanelView::pinchContainment(const Q
Link Here
|
| 850 |
(horizontal ? c->geometry().width() : |
850 |
(horizontal ? c->geometry().width() : |
| 851 |
c->geometry().height()) >= m_lastSeenSize) { |
851 |
c->geometry().height()) >= m_lastSeenSize) { |
| 852 |
// we are moving from a smaller space where we are 100% to a larger one |
852 |
// we are moving from a smaller space where we are 100% to a larger one |
| 853 |
kDebug() << "we are moving from a smaller space where we are 100% to a larger one"; |
|
|
| 854 |
c->setMinimumSize(0, 0); |
853 |
c->setMinimumSize(0, 0); |
| 855 |
c->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); |
854 |
c->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); |
| 856 |
|
855 |
|
|
Lines 867-901
void PanelView::pinchContainment(const Q
Link Here
|
| 867 |
c->setMinimumSize(min.width(), sh); |
866 |
c->setMinimumSize(min.width(), sh); |
| 868 |
} |
867 |
} |
| 869 |
} |
868 |
} |
| 870 |
} else if (m_lastSeenSize > (horizontal ? sw : sh) && |
|
|
| 871 |
(m_offset + (horizontal ? c->geometry().width() : |
| 872 |
c->geometry().height())) > (horizontal ? sw : sh)) { |
| 873 |
kDebug() << "we are moving from a bigger space to a smaller one where the panel won't fit!!"; |
| 874 |
if ((horizontal ? c->geometry().width() : |
| 875 |
c->geometry().height()) > (horizontal ? sw : sh)) { |
| 876 |
kDebug() << "panel is larger than screen, adjusting panel size"; |
| 877 |
setOffset(0); |
| 878 |
c->setMinimumSize(0, 0); |
| 879 |
c->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); |
| 880 |
|
| 881 |
if (horizontal) { |
| 882 |
c->setMaximumSize(sw, max.height()); |
| 883 |
c->resize(sw, c->geometry().height()); |
| 884 |
if (min.width() == max.width()) { |
| 885 |
c->setMinimumSize(sw, min.height()); |
| 886 |
} |
| 887 |
} else { |
| 888 |
c->setMaximumSize(max.width(), sh); |
| 889 |
c->resize(c->geometry().width(), sh); |
| 890 |
if (min.height() == max.height()) { |
| 891 |
c->setMinimumSize(min.width(), sh); |
| 892 |
} |
| 893 |
} |
| 894 |
} else { |
| 895 |
kDebug() << "reducing offset so the panel fits in screen"; |
| 896 |
setOffset((horizontal ? sw : sh) - |
| 897 |
(horizontal ? c->geometry().width() : c->geometry().height())); |
| 898 |
} |
| 899 |
} |
869 |
} |
| 900 |
} |
870 |
} |
| 901 |
|
871 |
|