Search line gets focus afer start
authorMateusz Półrola <mateusz.polrola@comarch.pl>
Wed, 8 Sep 2010 12:30:42 +0000 (14:30 +0200)
committerMateusz Półrola <mateusz.polrola@comarch.pl>
Wed, 8 Sep 2010 12:30:42 +0000 (14:30 +0200)
data/xsl/style.css
src/desktopWidget/MainWidget.cpp
src/mdictionary/gui/MainWindow.cpp
src/mdictionary/gui/NotifyManager.cpp
src/mdictionary/gui/SearchBarWidget.cpp
src/mdictionary/gui/SearchBarWidget.h

index 400f414..cf61a4d 100644 (file)
@@ -1,9 +1,45 @@
-th.info {
-       background-color        : #99FF99;     
+div.tab {
+       
+       border-style            : solid;
+       border-width            : 1px;
+       width                   : 100%
 }
 
-th.key {
-       background-color        : #99CCFF; 
+div.info {
+        font-weight            : bold;
+        text-align             : center;
+    
+       text-shadow            : black 5px 5px 10px;
+       background-color       : #99CCFF;
+
+       background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7ffff), to(#dfffff));
+       
+       padding-bottom: 8px;
+       padding-left: 10px;
+       padding-right: 10px;
+       padding-top: 8px;
+
+
+
+}
+
+div.key {
+       font-weight             : bold;
+       text-align              : center;
+       text-shadow            : black 5px 5px 10px;
+       /*margin                  : 2px 2px 2px 2px;   */
+       background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#dfffff), to(#fffcca));
+       padding-bottom: 8px;
+       padding-left: 10px;
+       padding-right: 10px;
+       padding-top: 8px;
+}
+
+div.cell {
+       /*border-style            : solid;
+       border-width            : thin;*/
+       /*margin                  : 2px 2px 2px 2px;*/
+       background: -webkit-gradient(linear, 0% 0%, 0% 150%, from(#fffcca), to(#FFFFFF));
 }
 
 span.i {
index a4977a6..7a455ca 100644 (file)
@@ -146,7 +146,8 @@ void HomeWidget::logoClicked() {
 void HomeWidget::paintEvent(QPaintEvent *event) {
     //custom painting of rounded corners
     QPainter p(this);
-    p.setBrush(QColor(0, 0, 0, 255));
+
+    p.setBrush(palette().background());
 
     p.setPen(Qt::NoPen);
 
index 71fe167..243f8c1 100644 (file)
@@ -48,6 +48,8 @@ MainWindow::MainWindow(Backbone *backbone, QWidget *parent):
     setExactSearch(false);
 
     showMaximized();
+
+    searchBarWidget->setFocus();
 }
 
 MainWindow::~MainWindow() {
index d8b60ed..f2fe70e 100644 (file)
@@ -103,6 +103,7 @@ void NotifyManager::showNotification(Notify::NotifyType type, QString text) {
             mbox->setIcon(QMessageBox::Information);
 
 
+
         #endif
         break;
 
index d9e73e9..f4ad398 100644 (file)
@@ -88,20 +88,33 @@ QIcon SearchBarWidget::generateIcon(QIcon oryginal, qreal rotation) {
     newIcon.addPixmap(p);
 
 
-    p.setMask(p.createHeuristicMask());
-   /* #ifdef Q_WS_MAEMO_5
-        QPainter painter(&p);
-        QColor c =  palette().background().color();
-       // c.setAlpha(192);
-        painter.fillRect(p.rect(), c);
+    #ifdef Q_WS_MAEMO_5
+        QImage img = p.toImage();
+
+        for(int i=0; i < img.width(); i++) {
+            for(int j=0; j < img.height(); j++) {
+                QColor c = img.pixel(i,j);
+                if(c != QColor(0,0,0,255)) {
+                    c.setRed(c.red()/2);
+                    c.setGreen(c.green()/2);
+                    c.setBlue(c.blue()/2);
+                    img.setPixel(i, j, c.rgb());
+                }
+            }
+        }
+        p = p.fromImage(img);
 
         newIcon.addPixmap(p, QIcon::Disabled, QIcon::Off);
-    #endif*/
+    #endif
 
     return newIcon;
 }
 
 
+void SearchBarWidget::setFocus() {
+    searchWordLineEdit->setFocus();
+}
+
 void SearchBarWidget::initializeUI() {
 
     #ifdef Q_WS_MAEMO_5
@@ -151,7 +164,7 @@ void SearchBarWidget::initializeUI() {
         clearSearchWordToolButton->setMaximumSize(
                 clearSearchWordToolButton->sizeHint().height()/2,
                 clearSearchWordToolButton->sizeHint().height()/2);
-        lineEditLayout->setContentsMargins(0,0,10,0);
+        lineEditLayout->setContentsMargins(0,0,15,0);
     #else
         clearSearchWordToolButton->setIcon(QIcon::fromTheme("edit-clear"));
         clearSearchWordToolButton->setMinimumSize(
index 4c04bf6..0309bd9 100644 (file)
@@ -112,6 +112,8 @@ public Q_SLOTS:
     */
     void updateHistoryButtons(bool prev, bool next, bool list);
 
+    void setFocus();
+
 private Q_SLOTS:
     //! Clears search word line edit
     void clearSearchWordToolButtonClicked();