author | zautrix <zautrix> | 2005-03-22 09:43:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 09:43:18 (UTC) |
commit | dfd7d8d53c7ab916dee820c2371195a5dce134a4 (patch) (unidiff) | |
tree | 9ae8f762a30ce340f1a90efc0a9829f83f7043c8 /korganizer | |
parent | d18536f758f4cf64d5c59d7a7c814e6ff12f9a3d (diff) | |
download | kdepimpi-dfd7d8d53c7ab916dee820c2371195a5dce134a4.zip kdepimpi-dfd7d8d53c7ab916dee820c2371195a5dce134a4.tar.gz kdepimpi-dfd7d8d53c7ab916dee820c2371195a5dce134a4.tar.bz2 |
more layout fixes
-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 | |||
@@ -1788,232 +1788,216 @@ void CalendarView::closeCalendar() | |||
1788 | } | 1788 | } |
1789 | 1789 | ||
1790 | void CalendarView::archiveCalendar() | 1790 | void CalendarView::archiveCalendar() |
1791 | { | 1791 | { |
1792 | mDialogManager->showArchiveDialog(); | 1792 | mDialogManager->showArchiveDialog(); |
1793 | } | 1793 | } |
1794 | 1794 | ||
1795 | 1795 | ||
1796 | void CalendarView::readSettings() | 1796 | void CalendarView::readSettings() |
1797 | { | 1797 | { |
1798 | 1798 | ||
1799 | 1799 | ||
1800 | // mViewManager->showAgendaView(); | 1800 | // mViewManager->showAgendaView(); |
1801 | QString str; | 1801 | QString str; |
1802 | //qDebug("CalendarView::readSettings() "); | 1802 | //qDebug("CalendarView::readSettings() "); |
1803 | // read settings from the KConfig, supplying reasonable | 1803 | // read settings from the KConfig, supplying reasonable |
1804 | // defaults where none are to be found | 1804 | // defaults where none are to be found |
1805 | KConfig *config = KOGlobals::config(); | 1805 | KConfig *config = KOGlobals::config(); |
1806 | #ifndef KORG_NOSPLITTER | 1806 | #ifndef KORG_NOSPLITTER |
1807 | config->setGroup("KOrganizer Geometry"); | 1807 | config->setGroup("KOrganizer Geometry"); |
1808 | 1808 | ||
1809 | QValueList<int> sizes = config->readIntListEntry("Separator1"); | 1809 | QValueList<int> sizes = config->readIntListEntry("Separator1"); |
1810 | if (sizes.count() != 2) { | 1810 | if (sizes.count() != 2) { |
1811 | sizes << mDateNavigator->minimumSizeHint().width(); | 1811 | sizes << mDateNavigator->minimumSizeHint().width(); |
1812 | sizes << 300; | 1812 | sizes << 300; |
1813 | } | 1813 | } |
1814 | mPanner->setSizes(sizes); | 1814 | mPanner->setSizes(sizes); |
1815 | 1815 | ||
1816 | sizes = config->readIntListEntry("Separator2"); | 1816 | sizes = config->readIntListEntry("Separator2"); |
1817 | if ( ( mResourceView && sizes.count() == 4 ) || | 1817 | if ( ( mResourceView && sizes.count() == 4 ) || |
1818 | ( !mResourceView && sizes.count() == 3 ) ) { | 1818 | ( !mResourceView && sizes.count() == 3 ) ) { |
1819 | mLeftSplitter->setSizes(sizes); | 1819 | mLeftSplitter->setSizes(sizes); |
1820 | } | 1820 | } |
1821 | #endif | 1821 | #endif |
1822 | globalFlagBlockAgenda = 1; | 1822 | globalFlagBlockAgenda = 1; |
1823 | mViewManager->showAgendaView(); | 1823 | mViewManager->showAgendaView(); |
1824 | //mViewManager->readSettings( config ); | 1824 | //mViewManager->readSettings( config ); |
1825 | mTodoList->restoreLayout(config,QString("Todo Layout")); | 1825 | mTodoList->restoreLayout(config,QString("Todo Layout")); |
1826 | readFilterSettings(config); | 1826 | readFilterSettings(config); |
1827 | 1827 | ||
1828 | #ifdef DESKTOP_VERSION | 1828 | #ifdef DESKTOP_VERSION |
1829 | config->setGroup("WidgetLayout"); | 1829 | config->setGroup("WidgetLayout"); |
1830 | QStringList list; | 1830 | QStringList list; |
1831 | list = config->readListEntry("MainLayout"); | 1831 | list = config->readListEntry("MainLayout"); |
1832 | int x,y,w,h; | 1832 | int x,y,w,h; |
1833 | if ( ! list.isEmpty() ) { | 1833 | if ( ! list.isEmpty() ) { |
1834 | x = list[0].toInt(); | 1834 | x = list[0].toInt(); |
1835 | y = list[1].toInt(); | 1835 | y = list[1].toInt(); |
1836 | w = list[2].toInt(); | 1836 | w = list[2].toInt(); |
1837 | h = list[3].toInt(); | 1837 | h = list[3].toInt(); |
1838 | topLevelWidget()->setGeometry(x,y,w,h); | 1838 | topLevelWidget()->setGeometry(x,y,w,h); |
1839 | 1839 | ||
1840 | } else { | 1840 | } else { |
1841 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); | 1841 | topLevelWidget()->setGeometry( 40 ,40 , 640, 440); |
1842 | } | 1842 | } |
1843 | list = config->readListEntry("EditEventLayout"); | 1843 | list = config->readListEntry("EditEventLayout"); |
1844 | if ( ! list.isEmpty() ) { | 1844 | if ( ! list.isEmpty() ) { |
1845 | x = list[0].toInt(); | 1845 | x = list[0].toInt(); |
1846 | y = list[1].toInt(); | 1846 | y = list[1].toInt(); |
1847 | w = list[2].toInt(); | 1847 | w = list[2].toInt(); |
1848 | h = list[3].toInt(); | 1848 | h = list[3].toInt(); |
1849 | mEventEditor->setGeometry(x,y,w,h); | 1849 | mEventEditor->setGeometry(x,y,w,h); |
1850 | 1850 | ||
1851 | } | 1851 | } |
1852 | list = config->readListEntry("EditTodoLayout"); | 1852 | list = config->readListEntry("EditTodoLayout"); |
1853 | if ( ! list.isEmpty() ) { | 1853 | if ( ! list.isEmpty() ) { |
1854 | x = list[0].toInt(); | 1854 | x = list[0].toInt(); |
1855 | y = list[1].toInt(); | 1855 | y = list[1].toInt(); |
1856 | w = list[2].toInt(); | 1856 | w = list[2].toInt(); |
1857 | h = list[3].toInt(); | 1857 | h = list[3].toInt(); |
1858 | mTodoEditor->setGeometry(x,y,w,h); | 1858 | mTodoEditor->setGeometry(x,y,w,h); |
1859 | 1859 | ||
1860 | } | 1860 | } |
1861 | list = config->readListEntry("ViewerLayout"); | 1861 | list = config->readListEntry("ViewerLayout"); |
1862 | if ( ! list.isEmpty() ) { | 1862 | if ( ! list.isEmpty() ) { |
1863 | x = list[0].toInt(); | 1863 | x = list[0].toInt(); |
1864 | y = list[1].toInt(); | 1864 | y = list[1].toInt(); |
1865 | w = list[2].toInt(); | 1865 | w = list[2].toInt(); |
1866 | h = list[3].toInt(); | 1866 | h = list[3].toInt(); |
1867 | getEventViewerDialog()->setGeometry(x,y,w,h); | 1867 | getEventViewerDialog()->setGeometry(x,y,w,h); |
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(); |
1940 | else mNavigator->selectDates( dateCount ); | 1924 | else mNavigator->selectDates( dateCount ); |
1941 | // mViewManager->readSettings( config ); | 1925 | // mViewManager->readSettings( config ); |
1942 | updateConfig(); | 1926 | updateConfig(); |
1943 | globalFlagBlockAgenda = 2; | 1927 | globalFlagBlockAgenda = 2; |
1944 | mViewManager->readSettings( config ); | 1928 | mViewManager->readSettings( config ); |
1945 | } | 1929 | } |
1946 | 1930 | ||
1947 | 1931 | ||
1948 | void CalendarView::writeSettings() | 1932 | void CalendarView::writeSettings() |
1949 | { | 1933 | { |
1950 | // kdDebug() << "CalendarView::writeSettings" << endl; | 1934 | // kdDebug() << "CalendarView::writeSettings" << endl; |
1951 | 1935 | ||
1952 | KConfig *config = KOGlobals::config(); | 1936 | KConfig *config = KOGlobals::config(); |
1953 | 1937 | ||
1954 | mViewManager->writeSettings( config ); | 1938 | mViewManager->writeSettings( config ); |
1955 | mTodoList->saveLayout(config,QString("Todo Layout")); | 1939 | mTodoList->saveLayout(config,QString("Todo Layout")); |
1956 | mDialogManager->writeSettings( config ); | 1940 | mDialogManager->writeSettings( config ); |
1957 | //KOPrefs::instance()->usrWriteConfig(); | 1941 | //KOPrefs::instance()->usrWriteConfig(); |
1958 | KOPrefs::instance()->writeConfig(); | 1942 | KOPrefs::instance()->writeConfig(); |
1959 | 1943 | ||
1960 | writeFilterSettings(config); | 1944 | writeFilterSettings(config); |
1961 | 1945 | ||
1962 | config->setGroup( "Views" ); | 1946 | config->setGroup( "Views" ); |
1963 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1947 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1964 | 1948 | ||
1965 | QValueList<int> listINT = mLeftFrame->sizes(); | 1949 | QValueList<int> listINT = mLeftFrame->sizes(); |
1966 | config->writeEntry("Left Splitter Frame",listINT); | 1950 | config->writeEntry("Left Splitter Frame",listINT); |
1967 | QValueList<int> listINT2 = mMainFrame->sizes(); | 1951 | QValueList<int> listINT2 = mMainFrame->sizes(); |
1968 | config->writeEntry("Main Splitter Frame",listINT2); | 1952 | config->writeEntry("Main Splitter Frame",listINT2); |
1969 | #ifdef DESKTOP_VERSION | 1953 | #ifdef DESKTOP_VERSION |
1970 | config->setGroup("WidgetLayout"); | 1954 | config->setGroup("WidgetLayout"); |
1971 | QStringList list ;//= config->readListEntry("MainLayout"); | 1955 | QStringList list ;//= config->readListEntry("MainLayout"); |
1972 | int x,y,w,h; | 1956 | int x,y,w,h; |
1973 | QWidget* wid; | 1957 | QWidget* wid; |
1974 | wid = topLevelWidget(); | 1958 | wid = topLevelWidget(); |
1975 | x = wid->geometry().x(); | 1959 | x = wid->geometry().x(); |
1976 | y = wid->geometry().y(); | 1960 | y = wid->geometry().y(); |
1977 | w = wid->width(); | 1961 | w = wid->width(); |
1978 | h = wid->height(); | 1962 | h = wid->height(); |
1979 | list.clear(); | 1963 | list.clear(); |
1980 | list << QString::number( x ); | 1964 | list << QString::number( x ); |
1981 | list << QString::number( y ); | 1965 | list << QString::number( y ); |
1982 | list << QString::number( w ); | 1966 | list << QString::number( w ); |
1983 | list << QString::number( h ); | 1967 | list << QString::number( h ); |
1984 | config->writeEntry("MainLayout",list ); | 1968 | config->writeEntry("MainLayout",list ); |
1985 | 1969 | ||
1986 | wid = mEventEditor; | 1970 | wid = mEventEditor; |
1987 | x = wid->geometry().x(); | 1971 | x = wid->geometry().x(); |
1988 | y = wid->geometry().y(); | 1972 | y = wid->geometry().y(); |
1989 | w = wid->width(); | 1973 | w = wid->width(); |
1990 | h = wid->height(); | 1974 | h = wid->height(); |
1991 | list.clear(); | 1975 | list.clear(); |
1992 | list << QString::number( x ); | 1976 | list << QString::number( x ); |
1993 | list << QString::number( y ); | 1977 | list << QString::number( y ); |
1994 | list << QString::number( w ); | 1978 | list << QString::number( w ); |
1995 | list << QString::number( h ); | 1979 | list << QString::number( h ); |
1996 | config->writeEntry("EditEventLayout",list ); | 1980 | config->writeEntry("EditEventLayout",list ); |
1997 | 1981 | ||
1998 | wid = mTodoEditor; | 1982 | wid = mTodoEditor; |
1999 | x = wid->geometry().x(); | 1983 | x = wid->geometry().x(); |
2000 | y = wid->geometry().y(); | 1984 | y = wid->geometry().y(); |
2001 | w = wid->width(); | 1985 | w = wid->width(); |
2002 | h = wid->height(); | 1986 | h = wid->height(); |
2003 | list.clear(); | 1987 | list.clear(); |
2004 | list << QString::number( x ); | 1988 | list << QString::number( x ); |
2005 | list << QString::number( y ); | 1989 | list << QString::number( y ); |
2006 | list << QString::number( w ); | 1990 | list << QString::number( w ); |
2007 | list << QString::number( h ); | 1991 | list << QString::number( h ); |
2008 | config->writeEntry("EditTodoLayout",list ); | 1992 | config->writeEntry("EditTodoLayout",list ); |
2009 | wid = getEventViewerDialog(); | 1993 | wid = getEventViewerDialog(); |
2010 | x = wid->geometry().x(); | 1994 | x = wid->geometry().x(); |
2011 | y = wid->geometry().y(); | 1995 | y = wid->geometry().y(); |
2012 | w = wid->width(); | 1996 | w = wid->width(); |
2013 | h = wid->height(); | 1997 | h = wid->height(); |
2014 | list.clear(); | 1998 | list.clear(); |
2015 | list << QString::number( x ); | 1999 | list << QString::number( x ); |
2016 | list << QString::number( y ); | 2000 | list << QString::number( y ); |
2017 | list << QString::number( w ); | 2001 | list << QString::number( w ); |
2018 | list << QString::number( h ); | 2002 | list << QString::number( h ); |
2019 | config->writeEntry("ViewerLayout",list ); | 2003 | config->writeEntry("ViewerLayout",list ); |
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index ab0dd50..18756f0 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -179,98 +179,98 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) | |||
179 | if ( horizontalCount == 1) | 179 | if ( horizontalCount == 1) |
180 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); | 180 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); |
181 | QFont fo; | 181 | QFont fo; |
182 | if ( horizontalCount != mHorizontalCount || | 182 | if ( horizontalCount != mHorizontalCount || |
183 | verticalCount != mVerticalCount ) { | 183 | verticalCount != mVerticalCount ) { |
184 | uint count = horizontalCount * verticalCount; | 184 | uint count = horizontalCount * verticalCount; |
185 | if ( count == 0 ) { | 185 | if ( count == 0 ) { |
186 | bool ok; | 186 | bool ok; |
187 | fo = mNavigatorView->yourFontHint( size() , &ok ); | 187 | fo = mNavigatorView->yourFontHint( size() , &ok ); |
188 | //mNavigatorView->resize( size() ); | 188 | //mNavigatorView->resize( size() ); |
189 | //if ( ! ok ) | 189 | //if ( ! ok ) |
190 | // return; | 190 | // return; |
191 | int butt = 2; | 191 | int butt = 2; |
192 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); | 192 | horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); |
193 | if ( horizontalCount <= 1 ) | 193 | if ( horizontalCount <= 1 ) |
194 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); | 194 | minSize = mNavigatorView->sizeHintTwoButtons( 4 ); |
195 | else | 195 | else |
196 | minSize = mNavigatorView->sizeHintTwoButtons(); | 196 | minSize = mNavigatorView->sizeHintTwoButtons(); |
197 | verticalCount = size().height() / minSize.height(); | 197 | verticalCount = size().height() / minSize.height(); |
198 | horizontalCount = size().width() / minSize.width(); | 198 | horizontalCount = size().width() / minSize.width(); |
199 | if ( horizontalCount == 0 ) | 199 | if ( horizontalCount == 0 ) |
200 | horizontalCount = 1; | 200 | horizontalCount = 1; |
201 | if ( verticalCount == 0 ) | 201 | if ( verticalCount == 0 ) |
202 | verticalCount = 1; | 202 | verticalCount = 1; |
203 | fontchange = true; | 203 | fontchange = true; |
204 | count = horizontalCount * verticalCount; | 204 | count = horizontalCount * verticalCount; |
205 | } else { | 205 | } else { |
206 | if ( mNavigatorView->fontChanged() ) { | 206 | if ( mNavigatorView->fontChanged() ) { |
207 | fontchange = true; | 207 | fontchange = true; |
208 | fo = KOPrefs::instance()->mDateNavigatorFont; | 208 | fo = KOPrefs::instance()->mDateNavigatorFont; |
209 | mNavigatorView->changeFont( fo ); | 209 | mNavigatorView->changeFont( fo ); |
210 | mNavigatorView->unsetFontChanged(); | 210 | mNavigatorView->unsetFontChanged(); |
211 | } | 211 | } |
212 | } | 212 | } |
213 | 213 | ||
214 | while ( count > ( mExtraViews.count() + 1 ) ) { | 214 | while ( count > ( mExtraViews.count() + 1 ) ) { |
215 | KDateNavigator *n = new KDateNavigator( this ); | 215 | KDateNavigator *n = new KDateNavigator( this ); |
216 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); | 216 | n->setMonthSignalOffset ( mExtraViews.count()+1 ); |
217 | mExtraViews.append( n ); | 217 | mExtraViews.append( n ); |
218 | n->setCalendar( mCalendar ); | 218 | n->setCalendar( mCalendar ); |
219 | setBaseDates(); | 219 | setBaseDates(); |
220 | connectNavigatorView( n ); | 220 | connectNavigatorView( n ); |
221 | n->show(); | 221 | n->show(); |
222 | } | 222 | } |
223 | int iii = 0; | 223 | int iii = 0; |
224 | while ( iii < ( mExtraViews.count() ) ) { | 224 | while ( iii < ( mExtraViews.count() ) ) { |
225 | if ( iii < count-1 ) | 225 | if ( iii < count-1 ) |
226 | mExtraViews.at( iii )->show(); | 226 | mExtraViews.at( iii )->show(); |
227 | else | 227 | else |
228 | mExtraViews.at( iii )->hide(); | 228 | mExtraViews.at( iii )->hide(); |
229 | ++iii; | 229 | ++iii; |
230 | } | 230 | } |
231 | if ( fontchange ) { | 231 | if ( fontchange ) { |
232 | //mNavigatorView->changeFont( fo ); | 232 | //mNavigatorView->changeFont( fo ); |
233 | uint i; | 233 | uint i; |
234 | for( i = 0; i < mExtraViews.count(); ++i ) { | 234 | for( i = 0; i < mExtraViews.count(); ++i ) { |
235 | KDateNavigator *view = mExtraViews.at( i ); | 235 | KDateNavigator *view = mExtraViews.at( i ); |
236 | view->changeFont( fo ); | 236 | view->changeFont( fo ); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | mHorizontalCount = horizontalCount; | 239 | mHorizontalCount = horizontalCount; |
240 | mVerticalCount = verticalCount; | 240 | mVerticalCount = verticalCount; |
241 | } | 241 | } |
242 | //qDebug("COUNT %d ", mExtraViews.count()); | 242 | //qDebug("COUNT %d ", mExtraViews.count()); |
243 | int height = size().height() / verticalCount; | 243 | int height = size().height() / verticalCount; |
244 | int width = size().width() / horizontalCount; | 244 | int width = size().width() / horizontalCount; |
245 | 245 | ||
246 | NavigatorBar *bar = mNavigatorView->navigatorBar(); | 246 | NavigatorBar *bar = mNavigatorView->navigatorBar(); |
247 | if ( horizontalCount > 1 ) bar->showButtons( true, false ); | 247 | if ( horizontalCount > 1 ) bar->showButtons( true, false ); |
248 | else bar->showButtons( true, true ); | 248 | else bar->showButtons( true, true ); |
249 | 249 | ||
250 | mNavigatorView->setGeometry(0, | 250 | mNavigatorView->setGeometry(0, |
251 | 0, width, height ); | 251 | 0, width, height ); |
252 | for( uint i = 0; i < mExtraViews.count(); ++i ) { | 252 | for( uint i = 0; i < mExtraViews.count(); ++i ) { |
253 | int x = ( i + 1 ) % horizontalCount; | 253 | int x = ( i + 1 ) % horizontalCount; |
254 | int y = ( i + 1 ) / horizontalCount; | 254 | int y = ( i + 1 ) / horizontalCount; |
255 | 255 | ||
256 | KDateNavigator *view = mExtraViews.at( i ); | 256 | KDateNavigator *view = mExtraViews.at( i ); |
257 | bar = view->navigatorBar(); | 257 | bar = view->navigatorBar(); |
258 | if ( y > 0 ) bar->showButtons( false, false ); | 258 | if ( y > 0 ) bar->showButtons( false, false ); |
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 | } |