Skip to content

Commit

Permalink
use our own color dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Calle Laakkonen committed Oct 19, 2008
1 parent f3eaac8 commit c20f51c
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/client/hostdialog.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
DrawPile - a collaborative drawing program.
Copyright (C) 2006-2007 Calle Laakkonen
Copyright (C) 2006-2008 Calle Laakkonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -19,14 +19,14 @@
*/

#include <QPushButton>
#include <QColorDialog>
#include <QFileDialog>
#include <QImageReader>

#include "main.h"
#include "hostdialog.h"
#include "imageselector.h"
#include "mandatoryfields.h"
#include "colordialog.h"
using widgets::ImageSelector;

#include <QSettings>
Expand Down Expand Up @@ -93,10 +93,14 @@ void HostDialog::rememberSettings() const
void HostDialog::selectColor()
{
const QColor oldcolor = ui_->imageSelector->color();
const QColor col = QColorDialog::getColor(oldcolor, this);
if(col.isValid() && col != oldcolor) {
ui_->imageSelector->setColor(col);
ui_->solidcolor->click();
dialogs::ColorDialog dlg(tr("Select a color"), false);
dlg.setColor(oldcolor);
if(dlg.exec() == QDialog::Accepted) {
QColor col = dlg.color();
if(col.isValid() && col != oldcolor) {
ui_->imageSelector->setColor(col);
ui_->solidcolor->click();
}
}
}

Expand Down

0 comments on commit c20f51c

Please sign in to comment.