-rw-r--r-- | korganizer/calendarview.cpp | 20 | ||||
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 2 |
2 files changed, 3 insertions, 19 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8100e25..9a4e719 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1868,72 +1868,56 @@ void CalendarView::readSettings() | |||
1868 | } | 1868 | } |
1869 | #endif | 1869 | #endif |
1870 | config->setGroup( "Views" ); | 1870 | config->setGroup( "Views" ); |
1871 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); | 1871 | int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); |
1872 | 1872 | ||
1873 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); | 1873 | QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); |
1874 | 1874 | ||
1875 | int resetval = 0; | 1875 | int resetval = 0; |
1876 | int maxVal = 0; | 1876 | int maxVal = 0; |
1877 | if (sizes.count() != 3) { | 1877 | if (sizes.count() != 3) { |
1878 | if ( KOPrefs::instance()->mVerticalScreen ) { | 1878 | if ( KOPrefs::instance()->mVerticalScreen ) { |
1879 | resetval = mDateNavigator->sizeHint().width()+2; | 1879 | resetval = mDateNavigator->sizeHint().width()+2; |
1880 | } else { | 1880 | } else { |
1881 | resetval = mDateNavigator->sizeHint().height()+2; | 1881 | resetval = mDateNavigator->sizeHint().height()+2; |
1882 | } | 1882 | } |
1883 | } | 1883 | } |
1884 | if ( !resetval ){// i.e. sizes.count() == 3 | ||
1885 | if ( KOPrefs::instance()->mVerticalScreen ) { | ||
1886 | if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) | ||
1887 | resetval = mDateNavigator->sizeHint().width()+2; | ||
1888 | } else { | ||
1889 | if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) | ||
1890 | resetval = mDateNavigator->sizeHint().height()+2; | ||
1891 | } | ||
1892 | } | ||
1893 | if ( resetval ) { | 1884 | if ( resetval ) { |
1894 | sizes.clear(); | 1885 | sizes.clear(); |
1895 | if ( KOPrefs::instance()->mVerticalScreen ) { | 1886 | if ( KOPrefs::instance()->mVerticalScreen ) { |
1896 | maxVal = QApplication::desktop()->width() -10; | 1887 | maxVal = QApplication::desktop()->width() -10; |
1897 | } else { | 1888 | } else { |
1898 | maxVal = QApplication::desktop()->height()-10; | 1889 | maxVal = QApplication::desktop()->height()-10; |
1899 | } | 1890 | } |
1900 | sizes << resetval; | 1891 | sizes << resetval; |
1901 | if ( maxVal < resetval + resetval) | 1892 | if ( maxVal < resetval + resetval) |
1902 | resetval = maxVal - resetval; | 1893 | resetval = maxVal - resetval; |
1903 | sizes << resetval; | 1894 | sizes << resetval; |
1904 | sizes << 100; | 1895 | sizes << 100; |
1905 | } | 1896 | } |
1906 | mLeftFrame->setSizes(sizes); | 1897 | mLeftFrame->setSizes(sizes); |
1907 | sizes = config->readIntListEntry("Main Splitter Frame"); | 1898 | sizes = config->readIntListEntry("Main Splitter Frame"); |
1899 | resetval = 0; | ||
1900 | maxVal = 0; | ||
1908 | if (sizes.count() != 2) { | 1901 | if (sizes.count() != 2) { |
1909 | if ( !KOPrefs::instance()->mVerticalScreen ) { | 1902 | if ( !KOPrefs::instance()->mVerticalScreen ) { |
1910 | resetval = mDateNavigator->sizeHint().width()+2; | 1903 | resetval = mDateNavigator->sizeHint().width()+2; |
1911 | } else { | 1904 | } else { |
1912 | resetval = mDateNavigator->sizeHint().height()+2; | 1905 | resetval = mDateNavigator->sizeHint().height()+2; |
1913 | } | 1906 | } |
1914 | } | 1907 | } |
1915 | if ( !resetval ){// i.e. sizes.count() == 3 | ||
1916 | if ( !KOPrefs::instance()->mVerticalScreen ) { | ||
1917 | if ( sizes[0] < mDateNavigator->sizeHint().width()+1 ) | ||
1918 | resetval = mDateNavigator->sizeHint().width()+2; | ||
1919 | } else { | ||
1920 | if ( sizes[0] < mDateNavigator->sizeHint().height()+1 ) | ||
1921 | resetval = mDateNavigator->sizeHint().height()+2; | ||
1922 | } | ||
1923 | } | ||
1924 | if ( resetval ) { | 1908 | if ( resetval ) { |
1925 | sizes.clear(); | 1909 | sizes.clear(); |
1926 | if ( !KOPrefs::instance()->mVerticalScreen ) { | 1910 | if ( !KOPrefs::instance()->mVerticalScreen ) { |
1927 | maxVal = QApplication::desktop()->width() -10; | 1911 | maxVal = QApplication::desktop()->width() -10; |
1928 | } else { | 1912 | } else { |
1929 | maxVal = QApplication::desktop()->height()-10; | 1913 | maxVal = QApplication::desktop()->height()-10; |
1930 | } | 1914 | } |
1931 | sizes << resetval; | 1915 | sizes << resetval; |
1932 | if ( maxVal < resetval + resetval) | 1916 | if ( maxVal < resetval + resetval) |
1933 | resetval = maxVal - resetval; | 1917 | resetval = maxVal - resetval; |
1934 | sizes << resetval; | 1918 | sizes << resetval; |
1935 | } | 1919 | } |
1936 | mMainFrame->setSizes(sizes); | 1920 | mMainFrame->setSizes(sizes); |
1937 | 1921 | ||
1938 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); | 1922 | if ( dateCount == 5 ) mNavigator->selectWorkWeek(); |
1939 | else if ( dateCount == 7 ) mNavigator->selectWeek(); | 1923 | else if ( dateCount == 7 ) mNavigator->selectWeek(); |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index ab0dd50..18756f0 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -259,18 +259,18 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | |||
259 | else { | 259 | else { |
260 | if ( x + 1 == horizontalCount ) bar->showButtons( false, true ); | 260 | if ( x + 1 == horizontalCount ) bar->showButtons( false, true ); |
261 | else bar->showButtons( false, false ); | 261 | else bar->showButtons( false, false ); |
262 | } | 262 | } |
263 | view->setGeometry( x * width, | 263 | view->setGeometry( x * width, |
264 | y * height, width, height ); | 264 | y * height, width, height ); |
265 | } | 265 | } |
266 | } | 266 | } |
267 | 267 | ||
268 | QSize DateNavigatorContainer::minimumSizeHint() const | 268 | QSize DateNavigatorContainer::minimumSizeHint() const |
269 | { | 269 | { |
270 | return mNavigatorView->minimumSizeHint(); | 270 | return mNavigatorView->minimumSizeHint(); |
271 | } | 271 | } |
272 | 272 | ||
273 | QSize DateNavigatorContainer::sizeHint() const | 273 | QSize DateNavigatorContainer::sizeHint() const |
274 | { | 274 | { |
275 | return mNavigatorView->sizeHint(); | 275 | return mNavigatorView->yourSizeHint(); |
276 | } | 276 | } |