Make single screen overlays better
This commit is contained in:
parent
ad1734927b
commit
c19221cd37
@ -34,7 +34,11 @@ ColorPickerScene::ColorPickerScene(QPixmap pixmap, QWidget *parentWidget)
|
|||||||
ellipse->setBrush(color);
|
ellipse->setBrush(color);
|
||||||
image = pixmap.toImage();
|
image = pixmap.toImage();
|
||||||
|
|
||||||
show();
|
if (QApplication::screens().size() == 1)
|
||||||
|
showFullScreen();
|
||||||
|
else
|
||||||
|
show();
|
||||||
|
|
||||||
activateWindow();
|
activateWindow();
|
||||||
setGeometry(pixmap.rect());
|
setGeometry(pixmap.rect());
|
||||||
QPoint p = screenshotutil::smallestScreenCoordinate()
|
QPoint p = screenshotutil::smallestScreenCoordinate()
|
||||||
|
@ -13,7 +13,10 @@
|
|||||||
CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
|
CropEditor::CropEditor(QPixmap image, QObject *parent) : QObject(parent) {
|
||||||
scene = new CropScene(parent, image);
|
scene = new CropScene(parent, image);
|
||||||
view = new CropView(scene);
|
view = new CropView(scene);
|
||||||
view->show();
|
if (QApplication::screens().size() > 1)
|
||||||
|
view->show();
|
||||||
|
else
|
||||||
|
view->showFullScreen();
|
||||||
view->raise();
|
view->raise();
|
||||||
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(image);
|
QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(image);
|
||||||
pixmapItem->setZValue(-1);
|
pixmapItem->setZValue(-1);
|
||||||
|
@ -200,9 +200,9 @@ void CropScene::show() {
|
|||||||
|
|
||||||
void CropScene::setVisible(bool visible) {
|
void CropScene::setVisible(bool visible) {
|
||||||
for (auto view : views()) {
|
for (auto view : views()) {
|
||||||
if (view->isVisible()) fullscreen |= view->isFullScreen();
|
|
||||||
view->setVisible(visible);
|
view->setVisible(visible);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
if (QApplication::screens().size() == 1) view->showFullScreen();
|
||||||
view->resize(_pixmap.width(), _pixmap.height());
|
view->resize(_pixmap.width(), _pixmap.height());
|
||||||
view->setMinimumSize(_pixmap.size());
|
view->setMinimumSize(_pixmap.size());
|
||||||
QPoint p = screenshotutil::smallestScreenCoordinate() + QPoint(settings::settings().value("cropx", 0).toInt(),
|
QPoint p = screenshotutil::smallestScreenCoordinate() + QPoint(settings::settings().value("cropx", 0).toInt(),
|
||||||
|
@ -61,7 +61,6 @@ private:
|
|||||||
void updateMag();
|
void updateMag();
|
||||||
void initMagnifierGrid();
|
void initMagnifierGrid();
|
||||||
void addDrawingAction(QMenuBar *menu, QString name, QString icon, std::function<DrawItem *()> item);
|
void addDrawingAction(QMenuBar *menu, QString name, QString icon, std::function<DrawItem *()> item);
|
||||||
bool fullscreen;
|
|
||||||
QPointF cursorPos;
|
QPointF cursorPos;
|
||||||
std::function<DrawItem *()> drawingSelectionMaker;
|
std::function<DrawItem *()> drawingSelectionMaker;
|
||||||
QFlags<Qt::MouseButton> prevButtons;
|
QFlags<Qt::MouseButton> prevButtons;
|
||||||
|
Loading…
Reference in New Issue
Block a user