Make single screen overlays better

This commit is contained in:
ArsenArsen 2017-08-03 22:00:15 +02:00
parent ad1734927b
commit c19221cd37
No known key found for this signature in database
GPG Key ID: C631EC9C50708CF4
4 changed files with 10 additions and 4 deletions

View File

@ -34,7 +34,11 @@ ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
ellipse->setBrush(color);
image = pixmap.toImage();
show();
if (QApplication::screens().size() == 1)
showFullScreen();
else
show();
activateWindow();
setGeometry(pixmap.rect());
QPoint p = screenshotutil::smallestScreenCoordinate()

View File

@ -13,7 +13,10 @@
CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
scene = new CropScene(parent, image);
view = new CropView(scene);
view->show();
if (QApplication::screens().size() > 1)
view->show();
else
view->showFullScreen();
view->raise();
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(image);
pixmapItem->setZValue(-1);

View File

@ -200,9 +200,9 @@ void CropScene::show() {
void CropScene::setVisible(bool visible) {
for (auto view : views()) {
if (view->isVisible()) fullscreen |= view->isFullScreen();
view->setVisible(visible);
if (visible) {
if (QApplication::screens().size() == 1) view->showFullScreen();
view->resize(_pixmap.width(), _pixmap.height());
view->setMinimumSize(_pixmap.size());
QPoint p = screenshotutil::smallestScreenCoordinate() + QPoint(settings::settings().value("cropx", 0).toInt(),

View File

@ -61,7 +61,6 @@ private:
void updateMag();
void initMagnifierGrid();
void addDrawingAction(QMenuBar *menu, QString name, QString icon, std::function<DrawItem *()> item);
bool fullscreen;
QPointF cursorPos;
std::function<DrawItem *()> drawingSelectionMaker;
QFlags<Qt::MouseButton> prevButtons;