From 87bfe1eed9dfab3f2c3df453af23a0c8a86a59ef Mon Sep 17 00:00:00 2001 From: defnax Date: Thu, 27 Mar 2008 23:40:37 +0000 Subject: [PATCH] Added Color feature to can set ToolBar/MenuBars gradient Colors. reordner MessagesDialog columns git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@430 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/MainWindow.cpp | 19 +++++++++++++++++++ retroshare-gui/src/gui/MainWindow.h | 2 +- retroshare-gui/src/gui/MessagesDialog.cpp | 17 ++++++++++------- retroshare-gui/src/gui/MessagesDialog.ui | 7 +++++-- retroshare-gui/src/gui/images.qrc | 1 + retroshare-gui/src/gui/images/highlight.png | Bin 0 -> 1239 bytes 6 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 retroshare-gui/src/gui/images/highlight.png diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 1c2ae1aac..fe58c23f3 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -67,6 +67,8 @@ #define IMAGE_CLOSE ":/images/close_normal.png" #define IMAGE_SMPLAYER ":/images/smplayer_icon32.png" #define IMAGE_BLOCK ":/images/blockdevice.png" +#define IMAGE_COLOR ":/images/highlight.png" + /* Keys for UI Preferences */ #define UI_PREF_PROMPT_ON_QUIT "UIOptions/ConfirmOnQuit" @@ -186,6 +188,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) //addAction(new QAction(QIcon(IMAGE_SMPLAYER), tr("SMPlayer"), ui.toolBar), SLOT(showsmplayer())); + @@ -194,6 +197,9 @@ MainWindow::MainWindow(QWidget* parent, Qt::WFlags flags) #else addAction(new QAction(QIcon(IMAGE_BLOCK), tr("Unfinished"), ui.toolBar), SLOT(showApplWindow())); #endif + + addAction(new QAction(QIcon(IMAGE_COLOR), tr("Color"), ui.toolBar), SLOT(setStyle())); + #ifdef NO_MORE_OPTIONS_OR_SS @@ -596,3 +602,16 @@ void MainWindow::showsmplayer() smplayer->gui()->show(); } + +void MainWindow::setStyle() +{ + QString standardSheet = "{background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,stop:0 , stop:1 );}"; + QColor stop1 = QColorDialog::getColor(Qt::white); + QColor stop2 = QColorDialog::getColor(Qt::black); + //QString widgetSheet = ".QWidget" + standardSheet.replace("", stop1.name()).replace("", stop2.name()); + QString toolSheet = "QToolBar" + standardSheet.replace("", stop1.name()).replace("", stop2.name()); + QString menuSheet = "QMenuBar" + standardSheet.replace("", stop1.name()).replace("", stop2.name()); + qApp->setStyleSheet(/*widgetSheet + */toolSheet + menuSheet); + +} + diff --git a/retroshare-gui/src/gui/MainWindow.h b/retroshare-gui/src/gui/MainWindow.h index b09ca02b4..0dfc30c82 100644 --- a/retroshare-gui/src/gui/MainWindow.h +++ b/retroshare-gui/src/gui/MainWindow.h @@ -126,7 +126,7 @@ private slots: void showsmplayer(); void showSettings(); - + void setStyle(); /** Called when console button is toggled */ void showConsoleFrame(bool show); diff --git a/retroshare-gui/src/gui/MessagesDialog.cpp b/retroshare-gui/src/gui/MessagesDialog.cpp index d528cf1da..9518c3bf3 100644 --- a/retroshare-gui/src/gui/MessagesDialog.cpp +++ b/retroshare-gui/src/gui/MessagesDialog.cpp @@ -77,14 +77,16 @@ MessagesDialog::MessagesDialog(QWidget *parent) /* hide the Tree +/- */ ui.msgList->setRootIsDecorated( false ); - + ui.msgWidget->setRootIsDecorated( false ); /* Set header resize modes and initial section sizes */ QHeaderView * msgwheader = ui.msgWidget->header () ; - msgwheader->setResizeMode (0, QHeaderView::Interactive); + msgwheader->setResizeMode (0, QHeaderView::Custom); + msgwheader->setResizeMode (3, QHeaderView::Interactive); - msgwheader->resizeSection ( 0, 140 ); - msgwheader->resizeSection ( 2, 150 ); + msgwheader->resizeSection ( 0, 24 ); + msgwheader->resizeSection ( 2, 250 ); + msgwheader->resizeSection ( 3, 140 ); /* Set header resize modes and initial section sizes */ QHeaderView * msglheader = ui.msgList->header () ; @@ -381,7 +383,7 @@ void MessagesDialog::insertMessages() QDateTime qtime; qtime.setTime_t(it->ts); QString timestamp = qtime.toString("yyyy-MM-dd hh:mm:ss"); - item -> setText(0, timestamp); + item -> setText(3, timestamp); } // From .... @@ -397,7 +399,7 @@ void MessagesDialog::insertMessages() { std::ostringstream out; out << it -> count; - item -> setText(3, QString::fromStdString(out.str())); + item -> setText(0, QString::fromStdString(out.str())); } item -> setText(4, QString::fromStdString(it->srcId)); @@ -661,4 +663,5 @@ void MessagesDialog::printpreview() preview->setWindowModality(Qt::WindowModal); preview->setAttribute(Qt::WA_DeleteOnClose); preview->show(); -} \ No newline at end of file +} + diff --git a/retroshare-gui/src/gui/MessagesDialog.ui b/retroshare-gui/src/gui/MessagesDialog.ui index febbcfb3b..2d1004c0b 100644 --- a/retroshare-gui/src/gui/MessagesDialog.ui +++ b/retroshare-gui/src/gui/MessagesDialog.ui @@ -751,7 +751,10 @@ p, li { white-space: pre-wrap; } - Date + + + + :/images/attachment.png @@ -766,7 +769,7 @@ p, li { white-space: pre-wrap; } - #Recommendations + Date diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index b8b3dffb5..b45455854 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -119,6 +119,7 @@ images/graph-area.png images/graph-line.png images/hide_toolbox_frame.png + images/highlight.png images/info16.png images/informations_24x24.png images/invite-friend24.png diff --git a/retroshare-gui/src/gui/images/highlight.png b/retroshare-gui/src/gui/images/highlight.png new file mode 100644 index 0000000000000000000000000000000000000000..54f6736de402958217fa350e473717873fe7eea7 GIT binary patch literal 1239 zcmX9;Yfuwc6u!F&dBB3P>bR-ciHeU_g$)lC5VC=&K|v9zgFMUoSc4{|c1MeSBV=h*uS_3BkdiUTj=@Wdr6_lH1Rx?0?kK zJ7*R`-q!%c-p3D^F~513+ltV1z5WAD8!yp{UB{e8KeE#qpB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