diff --git a/src/capture/capturewidget.cpp b/src/capture/capturewidget.cpp index 266dca59..7a60a330 100644 --- a/src/capture/capturewidget.cpp +++ b/src/capture/capturewidget.cpp @@ -52,7 +52,7 @@ namespace { CaptureWidget::CaptureWidget(QWidget *parent) : QWidget(parent), m_mouseOverHandle(0), m_mouseIsClicked(false), m_rightClick(false), m_newSelection(false), m_grabbing(false), - m_onButton(false), m_state(Button::Type::move) + m_onButton(false), m_showInitialMsg(true), m_state(Button::Type::move) { setAttribute(Qt::WA_DeleteOnClose); // create selection handlers @@ -143,10 +143,43 @@ void CaptureWidget::paintEvent(QPaintEvent *) { QRect r = m_selection.normalized().adjusted(0, 0, -1, -1); QRegion grey(rect()); grey = grey.subtracted(r); + painter.setClipRegion(grey); painter.drawRect(-1, -1, rect().width() + 1, rect().height() + 1); painter.setClipRect(rect()); + if(m_showInitialMsg) { + + QRect helpRect = QGuiApplication::primaryScreen()->geometry(); + + QString helpTxt = tr("Select an area with the mouse, or press Esc to exit." + "\nPress Enter to capture the screen." + "\nPress Right Click to choose the tool color."); + + // We draw the white contrasting background for the text, using the + //same text and options to get the boundingRect that the text will have. + QColor rectColor = m_uiColor; + rectColor.setAlpha(180); + QColor textColor((Button::iconIsWhite(rectColor) ? Qt::white : Qt::black)); + painter.setPen(QPen(textColor)); + //painter.setBrush(QBrush(QColor(255, 255, 255, 180), Qt::SolidPattern)); + painter.setBrush(QBrush(rectColor, Qt::SolidPattern)); + QRectF bRect = painter.boundingRect(helpRect, Qt::AlignCenter, helpTxt); + + // These four calls provide padding for the rect + bRect.setWidth(bRect.width() + 12); + bRect.setHeight(bRect.height() + 10); + bRect.setX(bRect.x() - 12); + bRect.setY(bRect.y() - 10); + + painter.drawRect(bRect); + + // Draw the text: + //painter.setPen(QPen(Qt::black)); + painter.setPen(textColor); + painter.drawText(helpRect, Qt::AlignCenter, helpTxt); + } + if (!m_selection.isNull()) { // paint selection rect painter.setPen(m_uiColor); @@ -163,6 +196,7 @@ void CaptureWidget::paintEvent(QPaintEvent *) { } void CaptureWidget::mousePressEvent(QMouseEvent *e) { + m_showInitialMsg = false; if (e->button() == Qt::RightButton) { m_rightClick = true; setCursor(Qt::ArrowCursor); diff --git a/src/capture/capturewidget.h b/src/capture/capturewidget.h index 69ab4296..42e2fab1 100644 --- a/src/capture/capturewidget.h +++ b/src/capture/capturewidget.h @@ -92,6 +92,7 @@ protected: bool m_newSelection; bool m_grabbing; bool m_onButton; + bool m_showInitialMsg; // naming convention for handles // T top, B bottom, R Right, L left diff --git a/translation/Internationalization_es.qm b/translation/Internationalization_es.qm deleted file mode 100644 index fb386e8f..00000000 Binary files a/translation/Internationalization_es.qm and /dev/null differ diff --git a/translation/Internationalization_es.ts b/translation/Internationalization_es.ts index 1a5518dc..d9cd12ee 100644 --- a/translation/Internationalization_es.ts +++ b/translation/Internationalization_es.ts @@ -167,7 +167,16 @@ CaptureWidget - + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to choose the tool color. + Selecciona un área con el ratón, or presiona Esc para salir. +Presiona Enter para capturar la pantalla. +Presiona Click Derecho para elegir color de herramienta. + + + Uploading image... Subiendo imagen... @@ -331,24 +340,24 @@ Selecciona un Botón para modificarlo - - + + Main Color Color Principal - + Click on this button to set the edition mode of the main color. Clica en este botón para aplicar el modo edición para el color primario. - + Contrast Color Color de Contraste - + Click on this button to set the edition mode of the contrast color. Clica en este botón para aplicar el modo edición para el color de contraste.