Permalink
Browse files

estilo visual da toolbar

  • Loading branch information...
1 parent ca98b59 commit 8f107d6729ae07f0a9b1fec4090ef5fa3feaf668 Paulo Cesar committed Nov 19, 2009
View
@@ -6,3 +6,4 @@ src/macuco
src/qrc_resources.cpp
macuco.pro.user
src/ui_errorbox.h
+src/macuco.app
View
@@ -80,7 +80,7 @@ void MainWindow::adjustSizes()
webView->setGeometry(0, 0, width(), height()); //webview cover the entire window
loadingLabel->setGeometry( width()/2 - 45, height()/2 - 45, 90, 90); //put the label on the center
errorBox->setGeometry( width()/2 - 150, height()/2 - 75, 300, 150); //put the error box on the center
- toolbar->setGeometry( 0, 450, 800, 30 );
+ toolbar->setGeometry( 0, 442, 800, 38 );
}
void MainWindow::resizeEvent(QResizeEvent* event)
View
@@ -4,5 +4,8 @@
<file>macuco.png</file>
<file>spinner.png</file>
<file>toolbar/back.png</file>
+ <file>toolbar/foward.png</file>
+ <file>toolbar/reload.png</file>
+ <file>toolbar/stop.png</file>
</qresource>
</RCC>
View
@@ -1,6 +1,8 @@
#include "toolbar.h"
#include "ui_toolbar.h"
+#include <QPainter>
+
Toolbar::Toolbar(QWidget *parent) :
QWidget(parent),
m_ui(new Ui::Toolbar)
@@ -15,5 +17,16 @@ Toolbar::~Toolbar()
void Toolbar::paintEvent ( QPaintEvent * event )
{
+ QRectF rectangle(-5, 0, 810, 38);
+
+ QPainter painter(this);
+
+ QLinearGradient linearGradient(0, 0, 0, 20);
+ linearGradient.setColorAt(0.0, QColor(180,180,180) );
+ linearGradient.setColorAt(0.33, Qt::gray );
+ linearGradient.setColorAt(1.0, QColor(120,120,120) );
+ painter.setPen( QColor(90, 90, 90) );
+ painter.setBrush(linearGradient);
+ painter.drawRect(rectangle);
}
View
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>540</width>
- <height>30</height>
+ <height>40</height>
</rect>
</property>
<property name="windowTitle">
@@ -23,23 +23,25 @@ border: 1px solid #888;
border-radius: 4px;
background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
-radius: 1.35, stop: 0 #fff, stop: 1 #aaa);
+radius: 1.35, stop: 0 #fff, stop: 1 #d2d2d2);
}
QToolButton:hover {
background: qradialgradient(cx: 0.3, cy: -0.4,
fx: 0.3, fy: -0.4,
-radius: 1.35, stop: 0 #fff, stop: 1 #bbb);
+radius: 1.35, stop: 0 #fff, stop: 1 #e2e2e2);
}
QToolButton:pressed {
background: qradialgradient(cx: 0.4, cy: -0.1,
fx: 0.4, fy: -0.1,
-radius: 1.35, stop: 0 #fff, stop: 1 #ddd);
+radius: 1.35, stop: 0 #fff, stop: 1 #c2c2c2);
}
-
QLineEdit {
color: black;
border: 1px solid #888;
border-radius: 4px;
+}
+Toolbar {
+background: rgb(144, 144, 144);
}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@@ -67,6 +69,12 @@ border-radius: 4px;
<iconset resource="resources.qrc">
<normaloff>:/images/toolbar/back.png</normaloff>:/images/toolbar/back.png</iconset>
</property>
+ <property name="iconSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
+ </property>
</widget>
</item>
<item>
@@ -75,7 +83,17 @@ border-radius: 4px;
<bool>false</bool>
</property>
<property name="text">
- <string>&gt;</string>
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/images/toolbar/foward.png</normaloff>:/images/toolbar/foward.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
@@ -85,17 +103,58 @@ border-radius: 4px;
<item>
<widget class="QToolButton" name="reloadButton">
<property name="text">
- <string>R</string>
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/images/toolbar/reload.png</normaloff>:/images/toolbar/reload.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>24</width>
+ <height>24</height>
+ </size>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="inputAddress"/>
+ <widget class="QLineEdit" name="inputAddress">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>24</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
+ </property>
+ </widget>
</item>
<item>
<widget class="QToolButton" name="favButton">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>24</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>28</height>
+ </size>
+ </property>
<property name="text">
- <string>:)</string>
+ <string>&lt;</string>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>16</width>
+ <height>24</height>
+ </size>
</property>
</widget>
</item>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading ui file 'toolbar.ui'
**
-** Created: Sun Nov 15 23:49:02 2009
+** Created: Thu Nov 19 20:01:04 2009
** by: Qt User Interface Compiler version 4.5.2
**
** WARNING! All changes made in this file will be lost when recompiling ui file!
@@ -36,31 +36,33 @@ class Ui_Toolbar
{
if (Toolbar->objectName().isEmpty())
Toolbar->setObjectName(QString::fromUtf8("Toolbar"));
- Toolbar->resize(540, 30);
+ Toolbar->resize(540, 40);
Toolbar->setAutoFillBackground(true);
Toolbar->setStyleSheet(QString::fromUtf8("QToolButton {\n"
"color: black;\n"
"border: 1px solid #888;\n"
"border-radius: 4px;\n"
"background: qradialgradient(cx: 0.3, cy: -0.4,\n"
"fx: 0.3, fy: -0.4,\n"
-"radius: 1.35, stop: 0 #fff, stop: 1 #aaa);\n"
+"radius: 1.35, stop: 0 #fff, stop: 1 #d2d2d2);\n"
"}\n"
"QToolButton:hover {\n"
"background: qradialgradient(cx: 0.3, cy: -0.4,\n"
"fx: 0.3, fy: -0.4,\n"
-"radius: 1.35, stop: 0 #fff, stop: 1 #bbb);\n"
+"radius: 1.35, stop: 0 #fff, stop: 1 #e2e2e2);\n"
"}\n"
"QToolButton:pressed {\n"
"background: qradialgradient(cx: 0.4, cy: -0.1,\n"
"fx: 0.4, fy: -0.1,\n"
-"radius: 1.35, stop: 0 #fff, stop: 1 #ddd);\n"
+"radius: 1.35, stop: 0 #fff, stop: 1 #c2c2c2);\n"
"}\n"
-"\n"
"QLineEdit {\n"
"color: black;\n"
"border: 1px solid #888;\n"
"border-radius: 4px;\n"
+"}\n"
+"Toolbar {\n"
+"background: rgb(144, 144, 144);\n"
"}"));
horizontalLayout = new QHBoxLayout(Toolbar);
horizontalLayout->setSpacing(6);
@@ -71,28 +73,50 @@ class Ui_Toolbar
QIcon icon;
icon.addFile(QString::fromUtf8(":/images/toolbar/back.png"), QSize(), QIcon::Normal, QIcon::Off);
backButton->setIcon(icon);
+ backButton->setIconSize(QSize(24, 24));
horizontalLayout->addWidget(backButton);
fowardButton = new QToolButton(Toolbar);
fowardButton->setObjectName(QString::fromUtf8("fowardButton"));
fowardButton->setAutoFillBackground(false);
+ QIcon icon1;
+ icon1.addFile(QString::fromUtf8(":/images/toolbar/foward.png"), QSize(), QIcon::Normal, QIcon::Off);
+ fowardButton->setIcon(icon1);
+ fowardButton->setIconSize(QSize(24, 24));
fowardButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
horizontalLayout->addWidget(fowardButton);
reloadButton = new QToolButton(Toolbar);
reloadButton->setObjectName(QString::fromUtf8("reloadButton"));
+ QIcon icon2;
+ icon2.addFile(QString::fromUtf8(":/images/toolbar/reload.png"), QSize(), QIcon::Normal, QIcon::Off);
+ reloadButton->setIcon(icon2);
+ reloadButton->setIconSize(QSize(24, 24));
horizontalLayout->addWidget(reloadButton);
inputAddress = new QLineEdit(Toolbar);
inputAddress->setObjectName(QString::fromUtf8("inputAddress"));
+ QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
+ sizePolicy.setHorizontalStretch(0);
+ sizePolicy.setVerticalStretch(24);
+ sizePolicy.setHeightForWidth(inputAddress->sizePolicy().hasHeightForWidth());
+ inputAddress->setSizePolicy(sizePolicy);
+ inputAddress->setMinimumSize(QSize(0, 28));
horizontalLayout->addWidget(inputAddress);
favButton = new QToolButton(Toolbar);
favButton->setObjectName(QString::fromUtf8("favButton"));
+ QSizePolicy sizePolicy1(QSizePolicy::Fixed, QSizePolicy::Fixed);
+ sizePolicy1.setHorizontalStretch(0);
+ sizePolicy1.setVerticalStretch(24);
+ sizePolicy1.setHeightForWidth(favButton->sizePolicy().hasHeightForWidth());
+ favButton->setSizePolicy(sizePolicy1);
+ favButton->setMinimumSize(QSize(0, 28));
+ favButton->setIconSize(QSize(16, 24));
horizontalLayout->addWidget(favButton);
@@ -106,9 +130,9 @@ class Ui_Toolbar
{
Toolbar->setWindowTitle(QApplication::translate("Toolbar", "Dialog", 0, QApplication::UnicodeUTF8));
backButton->setText(QString());
- fowardButton->setText(QApplication::translate("Toolbar", ">", 0, QApplication::UnicodeUTF8));
- reloadButton->setText(QApplication::translate("Toolbar", "R", 0, QApplication::UnicodeUTF8));
- favButton->setText(QApplication::translate("Toolbar", ":)", 0, QApplication::UnicodeUTF8));
+ fowardButton->setText(QString());
+ reloadButton->setText(QString());
+ favButton->setText(QApplication::translate("Toolbar", "<", 0, QApplication::UnicodeUTF8));
Q_UNUSED(Toolbar);
} // retranslateUi

0 comments on commit 8f107d6

Please sign in to comment.