fix window position

Change-Id: I0f1acdc77e2738008bd8d06924b4a81bab751e08
This commit is contained in:
石博文 2016-07-13 14:51:55 +08:00 committed by Hualet Wang
parent b4b28d499a
commit 78114a1fea
2 changed files with 7 additions and 4 deletions

View File

@ -37,6 +37,7 @@ void ThemeAppIcon::gtkInit(){
QPixmap ThemeAppIcon::getIconPixmap(QString iconPath, int width, int height){
Q_ASSERT(false);
if (iconPath.length() == 0){
iconPath = "application-x-desktop";
}
@ -128,6 +129,8 @@ QPixmap ThemeAppIcon::getIcon(const QString iconName, const int size)
QString fileName = getThemeIconPath(iconName, size);
if (fileName.isEmpty())
fileName = getThemeIconPath("application-x-desktop", size);
if (iconName.startsWith("data:image/"))
fileName = iconName;
QPixmap pixmap;
if (fileName.startsWith("data:image/")) {

View File

@ -183,13 +183,13 @@ void MainWindow::updateGeometry()
switch (position)
{
case Top:
move(primaryRect.topLeft().x() + offsetX, 0); break;
move(primaryRect.topLeft().x() + offsetX, primaryRect.y()); break;
case Left:
move(primaryRect.topLeft().x(), offsetY); break;
move(primaryRect.topLeft().x(), primaryRect.y() + offsetY); break;
case Right:
move(primaryRect.right() - size.width() + 1, offsetY); break;
move(primaryRect.right() - size.width() + 1, primaryRect.y() + offsetY); break;
case Bottom:
move(offsetX, primaryRect.bottom() - size.height() + 1); break;
move(primaryRect.x() + offsetX, primaryRect.bottom() - size.height() + 1); break;
default:
Q_ASSERT(false);
}