src/gui/styles/qwindowsvistastyle.cpp
changeset 33 3e2da88830cd
parent 18 2f34d5167611
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
  1924 {
  1924 {
  1925     if (!QWindowsVistaStylePrivate::useVista())
  1925     if (!QWindowsVistaStylePrivate::useVista())
  1926         return QWindowsStyle::sizeFromContents(type, option, size, widget);
  1926         return QWindowsStyle::sizeFromContents(type, option, size, widget);
  1927 
  1927 
  1928     QSize sz(size);
  1928     QSize sz(size);
  1929 
       
  1930     QSize newSize = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
       
  1931     switch (type) {
  1929     switch (type) {
  1932     case CT_LineEdit:
       
  1933     case CT_ComboBox:
       
  1934         {
       
  1935             HTHEME theme = pOpenThemeData(0, L"Button");
       
  1936             MARGINS borderSize;
       
  1937             if (theme) {
       
  1938                 int result = pGetThemeMargins(theme,
       
  1939                                               NULL,
       
  1940                                               BP_PUSHBUTTON,
       
  1941                                               PBS_NORMAL,
       
  1942                                               TMT_CONTENTMARGINS,
       
  1943                                               NULL,
       
  1944                                               &borderSize);
       
  1945                 if (result == S_OK) {
       
  1946                     sz += QSize(borderSize.cxLeftWidth + borderSize.cxRightWidth - 2,
       
  1947                                 borderSize.cyBottomHeight + borderSize.cyTopHeight - 2);
       
  1948                 }
       
  1949                 sz += QSize(23, 0); //arrow button
       
  1950             }
       
  1951         }
       
  1952         return sz;
       
  1953     case CT_MenuItem:
  1930     case CT_MenuItem:
  1954         sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
  1931         sz = QWindowsXPStyle::sizeFromContents(type, option, size, widget);
  1955         int minimumHeight;
  1932         int minimumHeight;
  1956         {
  1933         {
  1957             SIZE    size;
  1934             SIZE    size;
  1988         }
  1965         }
  1989         return sz;
  1966         return sz;
  1990     default:
  1967     default:
  1991         break;
  1968         break;
  1992     }
  1969     }
  1993     return newSize;
  1970     return QWindowsXPStyle::sizeFromContents(type, option, size, widget);
  1994 }
  1971 }
  1995 
  1972 
  1996 /*!
  1973 /*!
  1997  \internal
  1974  \internal
  1998  */
  1975  */