From 8e48e618430ee8bb4d9ec3b50737c370166ce8e8 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 16 Nov 2010 06:02:40 +0100 Subject: [PATCH] * Fixed long artist / track names resizing Tomahawk's main window. Now using ElidedLabel (Qt::ElideMiddle), a class dealing with too long labels. --- CMakeLists.txt | 2 +- qxt/CMakeLists.txt | 1 + .../qxtweb-standalone}/CMakeLists.txt | 0 .../qxtweb-standalone}/README.txt | 0 .../qxtweb-standalone}/example/main.cpp | 0 .../qxtweb-standalone}/example/myservice.h | 0 .../qxtweb/QxtAbstractHttpConnector | 0 .../qxtweb/QxtAbstractWebService | 0 .../qxtweb/QxtAbstractWebSessionManager | 0 .../qxtweb-standalone}/qxtweb/QxtHtmlTemplate | 0 .../qxtweb/QxtHttpServerConnector | 0 .../qxtweb/QxtHttpSessionManager | 0 .../qxtweb-standalone}/qxtweb/QxtMail | 0 .../qxtweb/QxtScgiServerConnector | 0 .../qxtweb-standalone}/qxtweb/QxtSendmail | 0 .../qxtweb-standalone}/qxtweb/QxtWeb | 0 .../qxtweb/QxtWebCgiService | 0 .../qxtweb-standalone}/qxtweb/QxtWebContent | 0 .../qxtweb/QxtWebErrorEvent | 0 .../qxtweb-standalone}/qxtweb/QxtWebEvent | 0 .../qxtweb/QxtWebFileUploadEvent | 0 .../qxtweb-standalone}/qxtweb/QxtWebPageEvent | 0 .../qxtweb/QxtWebRedirectEvent | 0 .../qxtweb/QxtWebRemoveCookieEvent | 0 .../qxtweb/QxtWebRequestEvent | 0 .../qxtweb/QxtWebServiceDirectory | 0 .../qxtweb/QxtWebSlotService | 0 .../qxtweb/QxtWebStoreCookieEvent | 0 .../qxtweb/qxtabstracthttpconnector.cpp | 0 .../qxtweb/qxtabstracthttpconnector.h | 0 .../qxtweb/qxtabstractwebservice.cpp | 0 .../qxtweb/qxtabstractwebservice.h | 0 .../qxtweb/qxtabstractwebsessionmanager.cpp | 0 .../qxtweb/qxtabstractwebsessionmanager.h | 0 .../qxtweb/qxtabstractwebsessionmanager_p.h | 0 .../qxtweb/qxtboundcfunction.h | 0 .../qxtweb/qxtboundfunction.h | 0 .../qxtweb/qxtboundfunctionbase.h | 0 .../qxtweb-standalone}/qxtweb/qxtglobal.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtglobal.h | 0 .../qxtweb/qxthtmltemplate.cpp | 0 .../qxtweb/qxthtmltemplate.h | 0 .../qxtweb/qxthttpserverconnector.cpp | 0 .../qxtweb/qxthttpsessionmanager.cpp | 0 .../qxtweb/qxthttpsessionmanager.h | 0 .../qxtweb/qxtmetaobject.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtmetaobject.h | 0 .../qxtweb-standalone}/qxtweb/qxtmetatype.h | 0 .../qxtweb-standalone}/qxtweb/qxtnull.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtnull.h | 0 .../qxtweb-standalone}/qxtweb/qxtnullable.h | 0 .../qxtweb/qxtscgiserverconnector.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtweb.h | 0 .../qxtweb/qxtwebcgiservice.cpp | 0 .../qxtweb/qxtwebcgiservice.h | 0 .../qxtweb/qxtwebcgiservice_p.h | 0 .../qxtweb/qxtwebcontent.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtwebcontent.h | 0 .../qxtweb-standalone}/qxtweb/qxtwebevent.cpp | 0 .../qxtweb-standalone}/qxtweb/qxtwebevent.h | 0 .../qxtweb/qxtwebservicedirectory.cpp | 0 .../qxtweb/qxtwebservicedirectory.h | 0 .../qxtweb/qxtwebservicedirectory_p.h | 0 .../qxtweb/qxtwebslotservice.cpp | 0 .../qxtweb/qxtwebslotservice.h | 0 src/CMakeLists.txt | 4 +- src/CMakeLists.win32.txt | 2 +- src/audiocontrols.cpp | 8 +- src/audiocontrols.h | 2 +- src/audiocontrols.ui | 7 +- src/playlist/trackview.cpp | 2 +- src/utils/elidedlabel.cpp | 171 ++++++++++++++++++ src/utils/elidedlabel.h | 53 ++++++ 73 files changed, 243 insertions(+), 9 deletions(-) create mode 100644 qxt/CMakeLists.txt rename {qxtweb-standalone => qxt/qxtweb-standalone}/CMakeLists.txt (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/README.txt (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/example/main.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/example/myservice.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtAbstractHttpConnector (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtAbstractWebService (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtAbstractWebSessionManager (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtHtmlTemplate (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtHttpServerConnector (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtHttpSessionManager (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtMail (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtScgiServerConnector (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtSendmail (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWeb (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebCgiService (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebContent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebErrorEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebFileUploadEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebPageEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebRedirectEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebRemoveCookieEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebRequestEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebServiceDirectory (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebSlotService (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/QxtWebStoreCookieEvent (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstracthttpconnector.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstracthttpconnector.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstractwebservice.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstractwebservice.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstractwebsessionmanager.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstractwebsessionmanager.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtabstractwebsessionmanager_p.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtboundcfunction.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtboundfunction.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtboundfunctionbase.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtglobal.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtglobal.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxthtmltemplate.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxthtmltemplate.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxthttpserverconnector.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxthttpsessionmanager.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxthttpsessionmanager.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtmetaobject.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtmetaobject.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtmetatype.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtnull.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtnull.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtnullable.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtscgiserverconnector.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtweb.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebcgiservice.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebcgiservice.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebcgiservice_p.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebcontent.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebcontent.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebevent.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebevent.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebservicedirectory.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebservicedirectory.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebservicedirectory_p.h (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebslotservice.cpp (100%) rename {qxtweb-standalone => qxt/qxtweb-standalone}/qxtweb/qxtwebslotservice.h (100%) create mode 100644 src/utils/elidedlabel.cpp create mode 100644 src/utils/elidedlabel.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 6255c2c9d..1405e1844 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,6 @@ ELSE() ENDIF( UNIX AND NOT APPLE ) ADD_SUBDIRECTORY( libportfwd ) -ADD_SUBDIRECTORY( qxtweb-standalone ) +ADD_SUBDIRECTORY( qxt ) ADD_SUBDIRECTORY( src ) diff --git a/qxt/CMakeLists.txt b/qxt/CMakeLists.txt new file mode 100644 index 000000000..5d66e2101 --- /dev/null +++ b/qxt/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY( qxtweb-standalone ) diff --git a/qxtweb-standalone/CMakeLists.txt b/qxt/qxtweb-standalone/CMakeLists.txt similarity index 100% rename from qxtweb-standalone/CMakeLists.txt rename to qxt/qxtweb-standalone/CMakeLists.txt diff --git a/qxtweb-standalone/README.txt b/qxt/qxtweb-standalone/README.txt similarity index 100% rename from qxtweb-standalone/README.txt rename to qxt/qxtweb-standalone/README.txt diff --git a/qxtweb-standalone/example/main.cpp b/qxt/qxtweb-standalone/example/main.cpp similarity index 100% rename from qxtweb-standalone/example/main.cpp rename to qxt/qxtweb-standalone/example/main.cpp diff --git a/qxtweb-standalone/example/myservice.h b/qxt/qxtweb-standalone/example/myservice.h similarity index 100% rename from qxtweb-standalone/example/myservice.h rename to qxt/qxtweb-standalone/example/myservice.h diff --git a/qxtweb-standalone/qxtweb/QxtAbstractHttpConnector b/qxt/qxtweb-standalone/qxtweb/QxtAbstractHttpConnector similarity index 100% rename from qxtweb-standalone/qxtweb/QxtAbstractHttpConnector rename to qxt/qxtweb-standalone/qxtweb/QxtAbstractHttpConnector diff --git a/qxtweb-standalone/qxtweb/QxtAbstractWebService b/qxt/qxtweb-standalone/qxtweb/QxtAbstractWebService similarity index 100% rename from qxtweb-standalone/qxtweb/QxtAbstractWebService rename to qxt/qxtweb-standalone/qxtweb/QxtAbstractWebService diff --git a/qxtweb-standalone/qxtweb/QxtAbstractWebSessionManager b/qxt/qxtweb-standalone/qxtweb/QxtAbstractWebSessionManager similarity index 100% rename from qxtweb-standalone/qxtweb/QxtAbstractWebSessionManager rename to qxt/qxtweb-standalone/qxtweb/QxtAbstractWebSessionManager diff --git a/qxtweb-standalone/qxtweb/QxtHtmlTemplate b/qxt/qxtweb-standalone/qxtweb/QxtHtmlTemplate similarity index 100% rename from qxtweb-standalone/qxtweb/QxtHtmlTemplate rename to qxt/qxtweb-standalone/qxtweb/QxtHtmlTemplate diff --git a/qxtweb-standalone/qxtweb/QxtHttpServerConnector b/qxt/qxtweb-standalone/qxtweb/QxtHttpServerConnector similarity index 100% rename from qxtweb-standalone/qxtweb/QxtHttpServerConnector rename to qxt/qxtweb-standalone/qxtweb/QxtHttpServerConnector diff --git a/qxtweb-standalone/qxtweb/QxtHttpSessionManager b/qxt/qxtweb-standalone/qxtweb/QxtHttpSessionManager similarity index 100% rename from qxtweb-standalone/qxtweb/QxtHttpSessionManager rename to qxt/qxtweb-standalone/qxtweb/QxtHttpSessionManager diff --git a/qxtweb-standalone/qxtweb/QxtMail b/qxt/qxtweb-standalone/qxtweb/QxtMail similarity index 100% rename from qxtweb-standalone/qxtweb/QxtMail rename to qxt/qxtweb-standalone/qxtweb/QxtMail diff --git a/qxtweb-standalone/qxtweb/QxtScgiServerConnector b/qxt/qxtweb-standalone/qxtweb/QxtScgiServerConnector similarity index 100% rename from qxtweb-standalone/qxtweb/QxtScgiServerConnector rename to qxt/qxtweb-standalone/qxtweb/QxtScgiServerConnector diff --git a/qxtweb-standalone/qxtweb/QxtSendmail b/qxt/qxtweb-standalone/qxtweb/QxtSendmail similarity index 100% rename from qxtweb-standalone/qxtweb/QxtSendmail rename to qxt/qxtweb-standalone/qxtweb/QxtSendmail diff --git a/qxtweb-standalone/qxtweb/QxtWeb b/qxt/qxtweb-standalone/qxtweb/QxtWeb similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWeb rename to qxt/qxtweb-standalone/qxtweb/QxtWeb diff --git a/qxtweb-standalone/qxtweb/QxtWebCgiService b/qxt/qxtweb-standalone/qxtweb/QxtWebCgiService similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebCgiService rename to qxt/qxtweb-standalone/qxtweb/QxtWebCgiService diff --git a/qxtweb-standalone/qxtweb/QxtWebContent b/qxt/qxtweb-standalone/qxtweb/QxtWebContent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebContent rename to qxt/qxtweb-standalone/qxtweb/QxtWebContent diff --git a/qxtweb-standalone/qxtweb/QxtWebErrorEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebErrorEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebErrorEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebErrorEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebFileUploadEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebFileUploadEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebFileUploadEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebFileUploadEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebPageEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebPageEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebPageEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebPageEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebRedirectEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebRedirectEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebRedirectEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebRedirectEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebRemoveCookieEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebRemoveCookieEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebRemoveCookieEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebRemoveCookieEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebRequestEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebRequestEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebRequestEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebRequestEvent diff --git a/qxtweb-standalone/qxtweb/QxtWebServiceDirectory b/qxt/qxtweb-standalone/qxtweb/QxtWebServiceDirectory similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebServiceDirectory rename to qxt/qxtweb-standalone/qxtweb/QxtWebServiceDirectory diff --git a/qxtweb-standalone/qxtweb/QxtWebSlotService b/qxt/qxtweb-standalone/qxtweb/QxtWebSlotService similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebSlotService rename to qxt/qxtweb-standalone/qxtweb/QxtWebSlotService diff --git a/qxtweb-standalone/qxtweb/QxtWebStoreCookieEvent b/qxt/qxtweb-standalone/qxtweb/QxtWebStoreCookieEvent similarity index 100% rename from qxtweb-standalone/qxtweb/QxtWebStoreCookieEvent rename to qxt/qxtweb-standalone/qxtweb/QxtWebStoreCookieEvent diff --git a/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.cpp b/qxt/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstracthttpconnector.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.cpp diff --git a/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.h b/qxt/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstracthttpconnector.h rename to qxt/qxtweb-standalone/qxtweb/qxtabstracthttpconnector.h diff --git a/qxtweb-standalone/qxtweb/qxtabstractwebservice.cpp b/qxt/qxtweb-standalone/qxtweb/qxtabstractwebservice.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstractwebservice.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtabstractwebservice.cpp diff --git a/qxtweb-standalone/qxtweb/qxtabstractwebservice.h b/qxt/qxtweb-standalone/qxtweb/qxtabstractwebservice.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstractwebservice.h rename to qxt/qxtweb-standalone/qxtweb/qxtabstractwebservice.h diff --git a/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.cpp b/qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.cpp diff --git a/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.h b/qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.h rename to qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager.h diff --git a/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager_p.h b/qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager_p.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager_p.h rename to qxt/qxtweb-standalone/qxtweb/qxtabstractwebsessionmanager_p.h diff --git a/qxtweb-standalone/qxtweb/qxtboundcfunction.h b/qxt/qxtweb-standalone/qxtweb/qxtboundcfunction.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtboundcfunction.h rename to qxt/qxtweb-standalone/qxtweb/qxtboundcfunction.h diff --git a/qxtweb-standalone/qxtweb/qxtboundfunction.h b/qxt/qxtweb-standalone/qxtweb/qxtboundfunction.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtboundfunction.h rename to qxt/qxtweb-standalone/qxtweb/qxtboundfunction.h diff --git a/qxtweb-standalone/qxtweb/qxtboundfunctionbase.h b/qxt/qxtweb-standalone/qxtweb/qxtboundfunctionbase.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtboundfunctionbase.h rename to qxt/qxtweb-standalone/qxtweb/qxtboundfunctionbase.h diff --git a/qxtweb-standalone/qxtweb/qxtglobal.cpp b/qxt/qxtweb-standalone/qxtweb/qxtglobal.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtglobal.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtglobal.cpp diff --git a/qxtweb-standalone/qxtweb/qxtglobal.h b/qxt/qxtweb-standalone/qxtweb/qxtglobal.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtglobal.h rename to qxt/qxtweb-standalone/qxtweb/qxtglobal.h diff --git a/qxtweb-standalone/qxtweb/qxthtmltemplate.cpp b/qxt/qxtweb-standalone/qxtweb/qxthtmltemplate.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxthtmltemplate.cpp rename to qxt/qxtweb-standalone/qxtweb/qxthtmltemplate.cpp diff --git a/qxtweb-standalone/qxtweb/qxthtmltemplate.h b/qxt/qxtweb-standalone/qxtweb/qxthtmltemplate.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxthtmltemplate.h rename to qxt/qxtweb-standalone/qxtweb/qxthtmltemplate.h diff --git a/qxtweb-standalone/qxtweb/qxthttpserverconnector.cpp b/qxt/qxtweb-standalone/qxtweb/qxthttpserverconnector.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxthttpserverconnector.cpp rename to qxt/qxtweb-standalone/qxtweb/qxthttpserverconnector.cpp diff --git a/qxtweb-standalone/qxtweb/qxthttpsessionmanager.cpp b/qxt/qxtweb-standalone/qxtweb/qxthttpsessionmanager.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxthttpsessionmanager.cpp rename to qxt/qxtweb-standalone/qxtweb/qxthttpsessionmanager.cpp diff --git a/qxtweb-standalone/qxtweb/qxthttpsessionmanager.h b/qxt/qxtweb-standalone/qxtweb/qxthttpsessionmanager.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxthttpsessionmanager.h rename to qxt/qxtweb-standalone/qxtweb/qxthttpsessionmanager.h diff --git a/qxtweb-standalone/qxtweb/qxtmetaobject.cpp b/qxt/qxtweb-standalone/qxtweb/qxtmetaobject.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtmetaobject.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtmetaobject.cpp diff --git a/qxtweb-standalone/qxtweb/qxtmetaobject.h b/qxt/qxtweb-standalone/qxtweb/qxtmetaobject.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtmetaobject.h rename to qxt/qxtweb-standalone/qxtweb/qxtmetaobject.h diff --git a/qxtweb-standalone/qxtweb/qxtmetatype.h b/qxt/qxtweb-standalone/qxtweb/qxtmetatype.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtmetatype.h rename to qxt/qxtweb-standalone/qxtweb/qxtmetatype.h diff --git a/qxtweb-standalone/qxtweb/qxtnull.cpp b/qxt/qxtweb-standalone/qxtweb/qxtnull.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtnull.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtnull.cpp diff --git a/qxtweb-standalone/qxtweb/qxtnull.h b/qxt/qxtweb-standalone/qxtweb/qxtnull.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtnull.h rename to qxt/qxtweb-standalone/qxtweb/qxtnull.h diff --git a/qxtweb-standalone/qxtweb/qxtnullable.h b/qxt/qxtweb-standalone/qxtweb/qxtnullable.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtnullable.h rename to qxt/qxtweb-standalone/qxtweb/qxtnullable.h diff --git a/qxtweb-standalone/qxtweb/qxtscgiserverconnector.cpp b/qxt/qxtweb-standalone/qxtweb/qxtscgiserverconnector.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtscgiserverconnector.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtscgiserverconnector.cpp diff --git a/qxtweb-standalone/qxtweb/qxtweb.h b/qxt/qxtweb-standalone/qxtweb/qxtweb.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtweb.h rename to qxt/qxtweb-standalone/qxtweb/qxtweb.h diff --git a/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp b/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.cpp diff --git a/qxtweb-standalone/qxtweb/qxtwebcgiservice.h b/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebcgiservice.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice.h diff --git a/qxtweb-standalone/qxtweb/qxtwebcgiservice_p.h b/qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice_p.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebcgiservice_p.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebcgiservice_p.h diff --git a/qxtweb-standalone/qxtweb/qxtwebcontent.cpp b/qxt/qxtweb-standalone/qxtweb/qxtwebcontent.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebcontent.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtwebcontent.cpp diff --git a/qxtweb-standalone/qxtweb/qxtwebcontent.h b/qxt/qxtweb-standalone/qxtweb/qxtwebcontent.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebcontent.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebcontent.h diff --git a/qxtweb-standalone/qxtweb/qxtwebevent.cpp b/qxt/qxtweb-standalone/qxtweb/qxtwebevent.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebevent.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtwebevent.cpp diff --git a/qxtweb-standalone/qxtweb/qxtwebevent.h b/qxt/qxtweb-standalone/qxtweb/qxtwebevent.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebevent.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebevent.h diff --git a/qxtweb-standalone/qxtweb/qxtwebservicedirectory.cpp b/qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebservicedirectory.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory.cpp diff --git a/qxtweb-standalone/qxtweb/qxtwebservicedirectory.h b/qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebservicedirectory.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory.h diff --git a/qxtweb-standalone/qxtweb/qxtwebservicedirectory_p.h b/qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory_p.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebservicedirectory_p.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebservicedirectory_p.h diff --git a/qxtweb-standalone/qxtweb/qxtwebslotservice.cpp b/qxt/qxtweb-standalone/qxtweb/qxtwebslotservice.cpp similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebslotservice.cpp rename to qxt/qxtweb-standalone/qxtweb/qxtwebslotservice.cpp diff --git a/qxtweb-standalone/qxtweb/qxtwebslotservice.h b/qxt/qxtweb-standalone/qxtweb/qxtwebslotservice.h similarity index 100% rename from qxtweb-standalone/qxtweb/qxtwebslotservice.h rename to qxt/qxtweb-standalone/qxtweb/qxtwebslotservice.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 09e08af42..cb1cdc338 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -98,6 +98,7 @@ SET( tomahawkSources ${tomahawkSources} SET( tomahawkSourcesGui ${tomahawkSourcesGui} xspfloader.cpp + utils/elidedlabel.cpp utils/imagebutton.cpp utils/progresstreeview.cpp utils/proxystyle.cpp @@ -215,6 +216,7 @@ SET( tomahawkHeaders ${tomahawkHeaders} SET( tomahawkHeadersGui ${tomahawkHeadersGui} xspfloader.h + utils/elidedlabel.h utils/animatedcounterlabel.h utils/imagebutton.h utils/progresstreeview.h @@ -277,7 +279,7 @@ INCLUDE_DIRECTORIES( ../rtaudio ../alsa-playback ../libportfwd/include - ../qxtweb-standalone/qxtweb/ + ../qxt/qxtweb-standalone/qxtweb /usr/include/taglib /usr/local/include/taglib diff --git a/src/CMakeLists.win32.txt b/src/CMakeLists.win32.txt index 8fb3c11f2..44d53325a 100644 --- a/src/CMakeLists.win32.txt +++ b/src/CMakeLists.win32.txt @@ -28,7 +28,7 @@ SET( OS_SPECIFIC_LINK_LIBRARIES "crypt32.dll" "ws2_32.dll" "dnsapi.dll" - "${CMAKE_CURRENT_SOURCE_DIR}/../qxtweb-standalone/libqxtweb-standalone.dll" + "${CMAKE_CURRENT_SOURCE_DIR}/../qxt/qxtweb-standalone/libqxtweb-standalone.dll" ) SET( tomahawkSourcesGui ${tomahawkSourcesGui} audio/rtaudiooutput.cpp ) diff --git a/src/audiocontrols.cpp b/src/audiocontrols.cpp index f4813be44..11c4589b1 100644 --- a/src/audiocontrols.cpp +++ b/src/audiocontrols.cpp @@ -28,6 +28,8 @@ AudioControls::AudioControls( QWidget* parent ) font.setPixelSize( 12 ); ui->artistTrackLabel->setFont( font ); + ui->artistTrackLabel->setElideMode( Qt::ElideMiddle ); + ui->albumLabel->setFont( font ); ui->timeLabel->setFont( font ); ui->timeLeftLabel->setFont( font ); @@ -119,7 +121,7 @@ AudioControls::AudioControls( QWidget* parent ) connect( ui->repeatButton, SIGNAL( clicked() ), SLOT( onRepeatClicked() ) ); connect( ui->shuffleButton, SIGNAL( clicked() ), SLOT( onShuffleClicked() ) ); - connect( ui->artistTrackLabel, SIGNAL( linkActivated( QString ) ), SLOT( onTrackClicked( QString ) ) ); + connect( ui->artistTrackLabel, SIGNAL( clicked() ), SLOT( onTrackClicked() ) ); // connect( (QObject*)TomahawkApp::instance()->audioEngine(), SIGNAL( loading( const Tomahawk::result_ptr& ) ), SLOT( onPlaybackLoading( const Tomahawk::result_ptr& ) ) ); @@ -223,7 +225,7 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result ) m_currentTrack = result; - ui->artistTrackLabel->setText( "" + QString( "%1 - %2" ).arg( result->artist() ).arg( result->track() ) + "" ); + ui->artistTrackLabel->setText( QString( "%1 - %2" ).arg( result->artist() ).arg( result->track() ) ); ui->albumLabel->setText( result->album() ); ui->ownerLabel->setText( result->collection()->source()->friendlyName() ); ui->coverImage->setPixmap( m_defaultCover ); @@ -407,7 +409,7 @@ AudioControls::onShuffleClicked() void -AudioControls::onTrackClicked( const QString& /* link */ ) +AudioControls::onTrackClicked() { APP->playlistManager()->showCurrentTrack(); } diff --git a/src/audiocontrols.h b/src/audiocontrols.h index efd13d789..94b81d198 100644 --- a/src/audiocontrols.h +++ b/src/audiocontrols.h @@ -38,7 +38,7 @@ private slots: void onRepeatClicked(); void onShuffleClicked(); - void onTrackClicked( const QString& link ); + void onTrackClicked(); void onCoverArtDownloaded(); diff --git a/src/audiocontrols.ui b/src/audiocontrols.ui index 2341c686c..c45bfc47e 100644 --- a/src/audiocontrols.ui +++ b/src/audiocontrols.ui @@ -206,7 +206,7 @@ - + PointingHandCursor @@ -455,6 +455,11 @@ QPushButton
imagebutton.h
+ + ElidedLabel + QLabel +
elidedlabel.h
+
diff --git a/src/playlist/trackview.cpp b/src/playlist/trackview.cpp index 44b866218..e29165134 100644 --- a/src/playlist/trackview.cpp +++ b/src/playlist/trackview.cpp @@ -85,7 +85,7 @@ TrackView::restoreColumnsState() if ( list.count() != 7 ) // FIXME: const { - m_columnWeights << 0.19 << 0.25 << 0.18 << 0.07 << 0.07 << 0.10 << 0.14; + m_columnWeights << 0.19 << 0.25 << 0.18 << 0.07 << 0.07 << 0.11 << 0.13; } else { diff --git a/src/utils/elidedlabel.cpp b/src/utils/elidedlabel.cpp new file mode 100644 index 000000000..795ec7bbc --- /dev/null +++ b/src/utils/elidedlabel.cpp @@ -0,0 +1,171 @@ +#include "elidedlabel.h" + +#include +#include +#include +#include +#include + + +ElidedLabel::ElidedLabel( QWidget* parent, Qt::WindowFlags flags ) + : QFrame( parent, flags ) +{ + init(); +} + + +ElidedLabel::ElidedLabel( const QString& text, QWidget* parent, Qt::WindowFlags flags ) + : QFrame( parent, flags ) +{ + init(text); +} + + +ElidedLabel::~ElidedLabel() +{ +} + + +QString +ElidedLabel::text() const +{ + return m_text; +} + + +void +ElidedLabel::setText( const QString& text ) +{ + if ( m_text != text ) + { + m_text = text; + updateLabel(); + emit textChanged( text ); + } +} + + +Qt::Alignment +ElidedLabel::alignment() const +{ + return align; +} + + +void +ElidedLabel::setAlignment( Qt::Alignment alignment ) +{ + if ( this->align != alignment ) + { + this->align = alignment; + update(); // no geometry change, repaint is sufficient + } +} + + +Qt::TextElideMode +ElidedLabel::elideMode() const +{ + return mode; +} + + +void +ElidedLabel::setElideMode( Qt::TextElideMode mode ) +{ + if ( this->mode != mode ) + { + this->mode = mode; + updateLabel(); + } +} + + +void +ElidedLabel::init( const QString& txt ) +{ + m_text = txt; + align = Qt::AlignLeft; + mode = Qt::ElideMiddle; +} + + +void +ElidedLabel::updateLabel() +{ + updateGeometry(); + update(); +} + + +QSize +ElidedLabel::sizeHint() const +{ + const QFontMetrics& fm = fontMetrics(); + QSize size( fm.width( m_text ), fm.height() ); + return size; +} + + +QSize +ElidedLabel::minimumSizeHint() const +{ + switch ( mode ) + { + case Qt::ElideNone: + return sizeHint(); + + default: + { + const QFontMetrics& fm = fontMetrics(); + QSize size( fm.width( "..." ), fm.height() ); + return size; + } + } +} + + +void +ElidedLabel::paintEvent( QPaintEvent* event ) +{ + QFrame::paintEvent( event ); + QPainter p( this ); + QRect r = contentsRect(); + const QString elidedText = fontMetrics().elidedText( m_text, mode, r.width() ); + p.drawText( r, align, elidedText ); +} + + +void +ElidedLabel::changeEvent( QEvent* event ) +{ + QFrame::changeEvent( event ); + switch ( event->type() ) + { + case QEvent::FontChange: + case QEvent::ApplicationFontChange: + updateLabel(); + break; + + default: + // nothing to do + break; + } +} + + +void +ElidedLabel::mousePressEvent( QMouseEvent* event ) +{ + QFrame::mousePressEvent( event ); + time.start(); +} + + +void +ElidedLabel::mouseReleaseEvent( QMouseEvent* event ) +{ + QFrame::mouseReleaseEvent( event ); + if ( time.elapsed() < qApp->doubleClickInterval() ) + emit clicked(); +} diff --git a/src/utils/elidedlabel.h b/src/utils/elidedlabel.h new file mode 100644 index 000000000..a3e4f5d4f --- /dev/null +++ b/src/utils/elidedlabel.h @@ -0,0 +1,53 @@ +#ifndef ELIDEDLABEL_H +#define ELIDEDLABEL_H + +#include +#include + +class ElidedLabel : public QFrame +{ + Q_OBJECT + Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged ) + Q_PROPERTY( Qt::Alignment alignment READ alignment WRITE setAlignment ) + Q_PROPERTY( Qt::TextElideMode elideMode READ elideMode WRITE setElideMode ) + +public: + explicit ElidedLabel( QWidget* parent = 0, Qt::WindowFlags flags = 0 ); + explicit ElidedLabel( const QString& text, QWidget* parent = 0, Qt::WindowFlags flags = 0 ); + virtual ~ElidedLabel(); + + QString text() const; + + Qt::Alignment alignment() const; + void setAlignment( Qt::Alignment alignment ); + + Qt::TextElideMode elideMode() const; + void setElideMode( Qt::TextElideMode mode ); + + virtual QSize sizeHint() const; + virtual QSize minimumSizeHint() const; + + void init( const QString& txt = QString() ); + void updateLabel(); + +public Q_SLOTS: + void setText( const QString& text ); + +Q_SIGNALS: + void clicked(); + void textChanged( const QString& text ); + +protected: + virtual void changeEvent( QEvent* event ); + virtual void mousePressEvent( QMouseEvent* event ); + virtual void mouseReleaseEvent( QMouseEvent* event ); + virtual void paintEvent( QPaintEvent* event ); + +private: + QTime time; + QString m_text; + Qt::Alignment align; + Qt::TextElideMode mode; +}; + +#endif // ELIDEDLABEL_H