]> git.sur5r.net Git - minitube/commitdiff
Windows look'n'feel tweaks
authorunknown <flavio@.(none)>
Tue, 4 Jan 2011 09:29:54 +0000 (10:29 +0100)
committerunknown <flavio@.(none)>
Tue, 4 Jan 2011 09:29:54 +0000 (10:29 +0100)
15 files changed:
locale/lupdate.sh [changed mode: 0755->0644]
minitube.pro [changed mode: 0755->0644]
resources.qrc [changed mode: 0755->0644]
src/AboutView.cpp
src/ListModel.cpp [changed mode: 0755->0644]
src/ListModel.h [changed mode: 0755->0644]
src/MainWindow.cpp [changed mode: 0755->0644]
src/MainWindow.h [changed mode: 0755->0644]
src/SearchView.cpp
src/constants.h [changed mode: 0755->0644]
src/downloaditem.cpp
src/fontutils.cpp
src/main.cpp [changed mode: 0755->0644]
src/thlibrary/thblackbar.cpp
src/video.cpp

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 1a0ec1730492455150abadb0431cc03fec66eaae..9342f91f044ddfdbcb23ec0e7cb85b4403691080 100644 (file)
@@ -21,7 +21,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
                    "<p>" + tr("There's life outside the browser!") + "</p>"
                    "<p>" + tr("Version %1").arg(Constants::VERSION) + "</p>"
                    + QString("<p><a href=\"%1/\">%1</a></p>").arg(Constants::WEBSITE) +
-#if !defined(APP_MAC) && !defined(Q_WS_WIN)
+#if !defined(APP_MAC) && !defined(APP_WIN)
                    "<p>" +  tr("%1 is Free Software but its development takes precious time.").arg(Constants::APP_NAME) + "<br/>"
                    + tr("Please <a href='%1'>donate</a> to support the continued development of %2.")
                    .arg(QString(Constants::WEBSITE).append("#donate"), Constants::APP_NAME) + "</p>"
@@ -30,7 +30,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
                    .arg(QString("<a href=\"mailto:%1\">%1</a>").arg(Constants::EMAIL)) + "</p>"
 
                    "<p>"
-                   + tr("Icon designed by %1.").arg("Sebastian Kraft")
+                   + tr("Icon designed by %1.").arg("<a href='http://www.kolorguild.com/'>David Nel</a>")
                    + "<br>" + tr("Compact mode contributed by %1.").arg("Stefan Brück")
                    + "<br>" + tr("HTTP proxy support contributed by %1.").arg("Kiwamu Okabe")
                    + "</p>"
@@ -62,7 +62,7 @@ AboutView::AboutView(QWidget *parent) : QWidget(parent) {
                                                       "Changtai Liang (zh_CN), "
                                                       "Veta Branislav (mkd_MKD)"
                                                       ) + "</p>"
-#if !defined(APP_MAC) && !defined(Q_WS_WIN)
+#if !defined(APP_MAC) && !defined(APP_WIN)
                    "<p>" + tr("Released under the <a href='%1'>GNU General Public License</a>")
                    .arg("http://www.gnu.org/licenses/gpl.html") + "</p>"
 #endif
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index c4c00b0..d5130ef
@@ -359,7 +359,9 @@ void MainWindow::createMenus() {
 
     helpMenu = menuBar()->addMenu(tr("&Help"));
     helpMenu->addAction(siteAct);
+#if !defined(APP_MAC) && !defined(APP_WIN)
     helpMenu->addAction(donateAct);
+#endif
     helpMenu->addAction(aboutAct);
 }
 
@@ -370,13 +372,21 @@ void MainWindow::createToolBars() {
     mainToolBar = new QToolBar(this);
 #if QT_VERSION < 0x040600 | defined(APP_MAC)
     mainToolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
+#elif defined(APP_WIN)
+    mainToolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
+    mainToolBar->setStyleSheet(
+            "QToolBar {"
+                "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #fff, stop:1 #ccc);"
+                "border: 0;"
+                "border-bottom: 1px solid #a0afc3;"
+            "}");
 #else
     mainToolBar->setToolButtonStyle(Qt::ToolButtonFollowStyle);
 #endif
     mainToolBar->setFloatable(false);
     mainToolBar->setMovable(false);
 
-#ifdef APP_MAC
+#if defined(APP_MAC) | defined(APP_WIN)
     mainToolBar->setIconSize(QSize(32, 32));
 #endif
 
@@ -447,7 +457,7 @@ void MainWindow::createStatusBar() {
 
     // remove ugly borders on OSX
     // also remove excessive spacing
-    statusBar()->setStyleSheet("::item{border:0 solid} QToolBar {padding:0;spacing:0;margin:0}");
+    statusBar()->setStyleSheet("::item{border:0 solid} QToolBar {padding:0;spacing:0;margin:0;border:0}");
 
     QToolBar *toolBar = new QToolBar(this);
     toolBar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
old mode 100755 (executable)
new mode 100644 (file)
index eda7d87805b5a6ad35494a9199883bf5e0eaca57..0e6deb3aed0c4643741e1b6c8e75129cda240e03 100644 (file)
@@ -14,7 +14,7 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) {
     QFont biggerFont = FontUtils::big();
     QFont smallerFont = FontUtils::smallBold();
 
-#ifdef APP_MAC
+#if defined(APP_MAC) | defined(APP_WIN)
     // speedup painting since we'll paint the whole background
     // by ourselves anyway in paintEvent()
     setAttribute(Qt::WA_OpaquePaintEvent);
@@ -115,7 +115,7 @@ SearchView::SearchView(QWidget *parent) : QWidget(parent) {
     recentKeywordsLayout->setSpacing(5);
     recentKeywordsLayout->setAlignment(Qt::AlignVCenter | Qt::AlignLeft);
     recentKeywordsLabel = new QLabel(tr("Recent keywords").toUpper(), this);
-#ifdef APP_MAC
+#if defined(APP_MAC) | defined(APP_WIN)
     QPalette palette = recentKeywordsLabel->palette();
     palette.setColor(QPalette::WindowText, QColor(0x65, 0x71, 0x80));
     recentKeywordsLabel->setPalette(palette);
@@ -244,7 +244,7 @@ void SearchView::gotNewVersion(QString version) {
 }
 
 void SearchView::paintEvent(QPaintEvent * /*event*/) {
-#ifdef APP_MAC
+#if defined(APP_MAC) | defined(APP_WIN)
     QBrush brush;
     if (window()->isActiveWindow()) {
         brush = QBrush(QColor(0xdd, 0xe4, 0xeb));
old mode 100755 (executable)
new mode 100644 (file)
index 1219fb489944ca9800af9aae1075e03cc648d544..dd5b278062592c4f30936e444bdc3e4c451b2d34 100644 (file)
@@ -90,7 +90,7 @@ void DownloadItem::tryAgain() {
 void DownloadItem::downloadReadyRead() {
 
     if (!m_file.isOpen()) {
-        if (!m_file.open(QIODevice::WriteOnly)) {
+        if (!m_file.open(QIODevice::ReadWrite)) {
             qDebug() << QString("Error opening output file: %1").arg(m_file.errorString());
             stop();
             emit statusChanged();
index 05384b8712530c656100863d7457f50ea04ade75..c5300b6f75f0a039feb28ed8e564fa6b0b21f968 100644 (file)
@@ -1,11 +1,14 @@
 #include "fontutils.h"
 
+static const int MIN_PIXEL_SIZE = 11;
+
 const QFont FontUtils::small() {
     static QFont font;
     static bool initialized = false;
     if (!initialized) {
       initialized = true;
       font.setPointSize(font.pointSize()*.85);
+      if (font.pixelSize() < MIN_PIXEL_SIZE) font.setPixelSize(MIN_PIXEL_SIZE);
     }
     return font;
 }
@@ -17,6 +20,7 @@ const QFont FontUtils::smallBold() {
       initialized = true;
       font.setPointSize(font.pointSize()*.85);
       font.setBold(true);
+      if (font.pixelSize() < MIN_PIXEL_SIZE) font.setPixelSize(MIN_PIXEL_SIZE);
     }
     return font;
 }
old mode 100755 (executable)
new mode 100644 (file)
index ddb24a8..6f0385f
@@ -5,6 +5,9 @@
 #ifdef APP_MAC
 // #include "local/mac/mac_startup.h"
 #endif
+#ifdef APP_WIN
+#include "local/win/qtwin.h"
+#endif
 
 int main(int argc, char **argv) {
 
@@ -66,6 +69,14 @@ int main(int argc, char **argv) {
     mainWin.setWindowIcon(appIcon);
 #endif
 
+#ifdef APP_WIN
+    if (QtWin::isCompositionEnabled()) {
+        QtWin::extendFrameIntoClientArea(&mainWin);
+        mainWin.setContentsMargins(0, 0, 0, 0);
+    }
+    app.setFont(QFont("Segoe UI", 9));
+#endif
+
     mainWin.show();
 
     app.setActivationWindow(&mainWin, true);
index 4101be04650a7705d50b1547cfd48a466ca442b8..6ea1b893f9d727624286c130fefcc64abfd642bd 100644 (file)
@@ -244,7 +244,7 @@ void THBlackBar::drawButton (       QPainter *painter,
 
     painter->fillRect(0, 0, width, mh, QBrush(gradient));
     painter->fillRect(0, mh, width, mh, color);
-#ifdef APP_MAC
+#if defined(APP_MAC) | defined(APP_WIN)
     painter->drawRect(-1, -1, width+1, height);
 #else
     painter->drawRect(0, 0, width, height);
index 7b7a803de33d28ca07a891e0690cf9a9192d9a6b..d0eb7c08e79fd934ac7b09bbafb95ab35bcc2173 100644 (file)
@@ -148,6 +148,7 @@ void  Video::gotVideoInfo(QByteArray data) {
         QString url = formatUrl.mid(separator + 1);
 
         if (format == definitionCode) {
+            qDebug() << "Found format" << definitionCode;
             QUrl videoUrl = QUrl::fromEncoded(url.toUtf8(), QUrl::StrictMode);
             m_streamUrl = videoUrl;
             emit gotStreamUrl(videoUrl);