flameshot-org / flameshot

Powerful yet simple to use screenshot software :desktop_computer: :camera_flash:
https://flameshot.org
GNU General Public License v3.0
23.95k stars 1.52k forks source link

On Off border when pin #3521

Open thatislg opened 4 months ago

thatislg commented 4 months ago

FLAMESHOT

Feature Description

I am editing this feature.

When flameshot in pin mode. We can turn on or off the border by double click. Chang the save or close to Delete key and Escape key.

This feature works well in Linux Mint and Windows 11.

Thank you.

mmahmoudian commented 4 months ago

Binding it to double-click will break existing workflow (at the moment double click closes the pin). I suggest adding it to the right-click menu and submit the PR :)

image

thatislg commented 4 months ago

Hi, I will check your idea.

I edited that, double click will not close the windows. The delete key or esc will do it.

🥹🥹🥹

But i am newbie s0... i need more times 🥹🥹🥹

thatislg commented 3 months ago

Binding it to double-click will break existing workflow (at the moment double click closes the pin). I suggest adding it to the right-click menu and submit the PR :)

FLAMESHOT

I have done this. Thank you for your idea.


I see that if I toggle border on/off. The pinned image moves a bit. I do not want that. But I still haven't found a method to do that. If you have any ideas, don't hesitate to let me know. Thank you so much.

BELOW IS MY CODE.

void PinWidget::turnOnOffBorder()
{
    // Border will be on or off depending ing the mouseDoubleClick
    onOffBorder = !onOffBorder;

    // Depend on the onOffBorder the Margin will be assigned
    int borderMargin = onOffBorder ? 7 : 0;
    int borderRadiusWhenMarginLess = borderMargin * 2;

    // Execute

    m_shadowEffect->setColor(m_baseColor);
    // QColor red(Qt::red);
    // m_shadowEffect->setColor(red);
    m_layout->setContentsMargins(
      borderMargin, borderMargin, borderMargin, borderMargin);

    m_shadowEffect->setBlurRadius(borderRadiusWhenMarginLess);
    m_shadowEffect->setOffset(0, 0);
    setGraphicsEffect(m_shadowEffect);
    setWindowOpacity(m_opacity);

    // Execute update
    m_sizeChanged = true;
    update();
}