diff options
| author | manuel <manuel@mausz.at> | 2011-04-07 18:01:35 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2011-04-07 18:01:35 +0200 |
| commit | 2d8de1ef8477d71c4d79e1ff292566809296e8fe (patch) | |
| tree | d221a3127582d6331bb0cadb6dd4166637db806f /pacman-c++ | |
| parent | e1d45435ca9d0a0a9fe3824108db566de00644c2 (diff) | |
| download | foop-2d8de1ef8477d71c4d79e1ff292566809296e8fe.tar.gz foop-2d8de1ef8477d71c4d79e1ff292566809296e8fe.tar.bz2 foop-2d8de1ef8477d71c4d79e1ff292566809296e8fe.zip | |
adding application icon
and trying to add actor icon. but this is really hackish
Diffstat (limited to 'pacman-c++')
| -rw-r--r-- | pacman-c++/client.cpp | 1 | ||||
| -rw-r--r-- | pacman-c++/mainwidget.cpp | 23 | ||||
| -rw-r--r-- | pacman-c++/pacman.pro | 5 | ||||
| -rw-r--r-- | pacman-c++/pacman.qrc | 6 | ||||
| -rw-r--r-- | pacman-c++/pacman.rc | 1 | ||||
| -rw-r--r-- | pacman-c++/pics/actor1icon.png | bin | 0 -> 232 bytes | |||
| -rw-r--r-- | pacman-c++/pics/actor2icon.png | bin | 0 -> 233 bytes | |||
| -rw-r--r-- | pacman-c++/pics/actor3icon.png | bin | 0 -> 231 bytes | |||
| -rw-r--r-- | pacman-c++/pics/actor4icon.png | bin | 0 -> 233 bytes | |||
| -rw-r--r-- | pacman-c++/pics/app.ico | bin | 0 -> 174 bytes | |||
| -rw-r--r-- | pacman-c++/style.qss | 27 |
11 files changed, 56 insertions, 7 deletions
diff --git a/pacman-c++/client.cpp b/pacman-c++/client.cpp index cf3c291..47bbc4e 100644 --- a/pacman-c++/client.cpp +++ b/pacman-c++/client.cpp | |||
| @@ -16,6 +16,7 @@ Client::Client() | |||
| 16 | int main(int argc, char ** argv) { | 16 | int main(int argc, char ** argv) { |
| 17 | QApplication app(argc, argv); | 17 | QApplication app(argc, argv); |
| 18 | app.setApplicationName("pacman-client"); | 18 | app.setApplicationName("pacman-client"); |
| 19 | app.setWindowIcon(QIcon(":/appicon")); | ||
| 19 | 20 | ||
| 20 | qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); | 21 | qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); |
| 21 | 22 | ||
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp index 780312f..e8a4250 100644 --- a/pacman-c++/mainwidget.cpp +++ b/pacman-c++/mainwidget.cpp | |||
| @@ -46,7 +46,6 @@ Transmission::map_t createDummyMap() | |||
| 46 | " # # " | 46 | " # # " |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | |||
| 50 | for (unsigned int x = 0; x < Constants::map_size.width; ++x) | 49 | for (unsigned int x = 0; x < Constants::map_size.width; ++x) |
| 51 | { | 50 | { |
| 52 | for (unsigned int y = 0; y < Constants::map_size.height; ++y) | 51 | for (unsigned int y = 0; y < Constants::map_size.height; ++y) |
| @@ -114,11 +113,12 @@ void MainWidget::createGui() | |||
| 114 | 113 | ||
| 115 | for (unsigned int i = 1; i < 4; ++i) | 114 | for (unsigned int i = 1; i < 4; ++i) |
| 116 | { | 115 | { |
| 117 | QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this); | 116 | QGroupBox *scoreBox = new QGroupBox(QString(" Spieler %1").arg(i), this); |
| 118 | m_scoreLayout->addWidget(scoreBoxI); | 117 | scoreBox->setObjectName(QString("actor%1").arg(i)); |
| 118 | m_scoreLayout->addWidget(scoreBox); | ||
| 119 | 119 | ||
| 120 | QGridLayout *playerLayout = new QGridLayout(); | 120 | QGridLayout *playerLayout = new QGridLayout(); |
| 121 | scoreBoxI->setLayout(playerLayout); | 121 | scoreBox->setLayout(playerLayout); |
| 122 | 122 | ||
| 123 | playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0); | 123 | playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0); |
| 124 | playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0); | 124 | playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0); |
| @@ -126,6 +126,12 @@ void MainWidget::createGui() | |||
| 126 | playerLayout->addWidget(new QLabel("", this), 0, 1); | 126 | playerLayout->addWidget(new QLabel("", this), 0, 1); |
| 127 | playerLayout->addWidget(new QLabel("", this), 1, 1); | 127 | playerLayout->addWidget(new QLabel("", this), 1, 1); |
| 128 | 128 | ||
| 129 | /*Actor *tmp1 = new Actor(Color::red); | ||
| 130 | QGraphicsScene *tmp2 = new QGraphicsScene(0, 0, 16, 16, this); | ||
| 131 | QLabel *tmp3 = new QLabel("hfghgfhgfhgfh", this); | ||
| 132 | tmp3->setPixmap(QPixmap(":/actor1")); | ||
| 133 | playerLayout->addWidget(tmp3, 0, 2);*/ | ||
| 134 | |||
| 129 | m_playerScoreLayouts.append(playerLayout); | 135 | m_playerScoreLayouts.append(playerLayout); |
| 130 | } | 136 | } |
| 131 | 137 | ||
| @@ -135,16 +141,19 @@ void MainWidget::createGui() | |||
| 135 | QGraphicsView *window = new QGraphicsView(m_scene, this); | 141 | QGraphicsView *window = new QGraphicsView(m_scene, this); |
| 136 | window->setFrameStyle(0); | 142 | window->setFrameStyle(0); |
| 137 | window->setAlignment(Qt::AlignLeft | Qt::AlignTop); | 143 | window->setAlignment(Qt::AlignLeft | Qt::AlignTop); |
| 138 | //window->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||
| 139 | //window->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); | ||
| 140 | window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); | 144 | window->setFixedSize(Constants::map_size_pixel.width, Constants::map_size_pixel.height); |
| 141 | window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); | 145 | window->setWindowFlags(window->windowFlags() & ~Qt::WindowMaximizeButtonHint); |
| 142 | 146 | ||
| 143 | layout->addLayout(m_scoreLayout); | 147 | layout->addLayout(m_scoreLayout); |
| 144 | layout->addWidget(window); | 148 | layout->addWidget(window); |
| 145 | 149 | ||
| 150 | QFile css(":/stylesheet"); | ||
| 151 | css.open(QFile::ReadOnly); | ||
| 152 | qApp->setStyleSheet(QLatin1String(css.readAll())); | ||
| 153 | |||
| 146 | setLayout(layout); | 154 | setLayout(layout); |
| 147 | setWindowTitle("pacman client"); | 155 | //TODO: this doesn't work?!?! |
| 156 | setWindowTitle("FOOP Pacman Client"); | ||
| 148 | } | 157 | } |
| 149 | 158 | ||
| 150 | void MainWidget::updateScore() | 159 | void MainWidget::updateScore() |
diff --git a/pacman-c++/pacman.pro b/pacman-c++/pacman.pro index 68d1be9..e995c81 100644 --- a/pacman-c++/pacman.pro +++ b/pacman-c++/pacman.pro | |||
| @@ -20,5 +20,10 @@ RESOURCES += pacman.qrc | |||
| 20 | 20 | ||
| 21 | OBJECTS_DIR = .obj | 21 | OBJECTS_DIR = .obj |
| 22 | MOC_DIR = .moc | 22 | MOC_DIR = .moc |
| 23 | RC_FILE = pacman.rc | ||
| 23 | 24 | ||
| 24 | CONFIG += debug | 25 | CONFIG += debug |
| 26 | |||
| 27 | OTHER_FILES += \ | ||
| 28 | style.qss \ | ||
| 29 | pacman.rc | ||
diff --git a/pacman-c++/pacman.qrc b/pacman-c++/pacman.qrc index 3752ebe..ceb032a 100644 --- a/pacman-c++/pacman.qrc +++ b/pacman-c++/pacman.qrc | |||
| @@ -11,6 +11,12 @@ | |||
| 11 | <file alias="block4">pics/block4.png</file> | 11 | <file alias="block4">pics/block4.png</file> |
| 12 | <file alias="bonuspoints">pics/bonuspoints.png</file> | 12 | <file alias="bonuspoints">pics/bonuspoints.png</file> |
| 13 | <file alias="points">pics/points.png</file> | 13 | <file alias="points">pics/points.png</file> |
| 14 | <file alias="stylesheet">style.qss</file> | ||
| 15 | <file alias="appicon">pics/app.ico</file> | ||
| 16 | <file alias="actor1icon">pics/actor1icon.png</file> | ||
| 17 | <file alias="actor2icon">pics/actor2icon.png</file> | ||
| 18 | <file alias="actor3icon">pics/actor3icon.png</file> | ||
| 19 | <file alias="actor4icon">pics/actor4icon.png</file> | ||
| 14 | </qresource> | 20 | </qresource> |
| 15 | <qresource prefix="/sound"> | 21 | <qresource prefix="/sound"> |
| 16 | <file alias="wakawaka">sound/waka_waka.ogg</file> | 22 | <file alias="wakawaka">sound/waka_waka.ogg</file> |
diff --git a/pacman-c++/pacman.rc b/pacman-c++/pacman.rc new file mode 100644 index 0000000..808718b --- /dev/null +++ b/pacman-c++/pacman.rc | |||
| @@ -0,0 +1 @@ | |||
| IDI_ICON1 ICON DISCARDABLE "pics/pacman.ico" | |||
diff --git a/pacman-c++/pics/actor1icon.png b/pacman-c++/pics/actor1icon.png new file mode 100644 index 0000000..4407cef --- /dev/null +++ b/pacman-c++/pics/actor1icon.png | |||
| Binary files differ | |||
diff --git a/pacman-c++/pics/actor2icon.png b/pacman-c++/pics/actor2icon.png new file mode 100644 index 0000000..eaf2a4c --- /dev/null +++ b/pacman-c++/pics/actor2icon.png | |||
| Binary files differ | |||
diff --git a/pacman-c++/pics/actor3icon.png b/pacman-c++/pics/actor3icon.png new file mode 100644 index 0000000..2558cbc --- /dev/null +++ b/pacman-c++/pics/actor3icon.png | |||
| Binary files differ | |||
diff --git a/pacman-c++/pics/actor4icon.png b/pacman-c++/pics/actor4icon.png new file mode 100644 index 0000000..82bf637 --- /dev/null +++ b/pacman-c++/pics/actor4icon.png | |||
| Binary files differ | |||
diff --git a/pacman-c++/pics/app.ico b/pacman-c++/pics/app.ico new file mode 100644 index 0000000..4a73cd4 --- /dev/null +++ b/pacman-c++/pics/app.ico | |||
| Binary files differ | |||
diff --git a/pacman-c++/style.qss b/pacman-c++/style.qss new file mode 100644 index 0000000..74ba1b8 --- /dev/null +++ b/pacman-c++/style.qss | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | QGroupBox#actor1::title { | ||
| 2 | background-image: url(:/actor1icon); | ||
| 3 | background-position: top left; | ||
| 4 | background-repeat: no-repeat; | ||
| 5 | background-color: palette(window); | ||
| 6 | } | ||
| 7 | |||
| 8 | QGroupBox#actor2::title { | ||
| 9 | background-image: url(:/actor2icon); | ||
| 10 | background-position: top left; | ||
| 11 | background-repeat: no-repeat; | ||
| 12 | background-color: palette(window); | ||
| 13 | } | ||
| 14 | |||
| 15 | QGroupBox#actor3::title { | ||
| 16 | background-image: url(:/actor3icon); | ||
| 17 | background-position: top left; | ||
| 18 | background-repeat: no-repeat; | ||
| 19 | background-color: palette(window); | ||
| 20 | } | ||
| 21 | |||
| 22 | QGroupBox#actor4::title { | ||
| 23 | background-image: url(:/actor4icon); | ||
| 24 | background-position: top left; | ||
| 25 | background-repeat: no-repeat; | ||
| 26 | background-color: palette(window); | ||
| 27 | } | ||
