mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
MaxMinimize on titlebar doubleclick
This commit is contained in:
parent
3ad4fcf83b
commit
231b26fcb7
5 changed files with 12 additions and 3 deletions
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
#define LLOG(x) DLOG(x)
|
||||
|
||||
Ptr<Ctrl> Ctrl::eventCtrl;
|
||||
Ptr<Ctrl> Ctrl::mouseCtrl;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ void TopWindow::CustomBarIcon::MouseLeave()
|
|||
Refresh();
|
||||
}
|
||||
|
||||
void TopWindow::BarCtrl::LeftDouble(Point p, dword keyflags)
|
||||
{
|
||||
DLOG("HERE!");
|
||||
WhenAction();
|
||||
}
|
||||
|
||||
void TopWindow::Init()
|
||||
{
|
||||
custom_titlebar_metrics__ = [](const TopWindow *tw, TopWindow::CustomTitleBarMetrics& m) {
|
||||
|
|
@ -124,7 +130,7 @@ Ctrl *TopWindow::MakeCustomTitleBar__(Color bk, int mincy)
|
|||
if(w)
|
||||
gtk_window_iconify(w);
|
||||
};
|
||||
maxicon << [=] {
|
||||
*custom_bar ^= maxicon ^= [=] {
|
||||
GtkWindow *w = gtk();
|
||||
if(w) {
|
||||
if(gtk_window_is_maximized(w))
|
||||
|
|
|
|||
|
|
@ -14,10 +14,13 @@
|
|||
void Set(const Image& m) { if(!m.IsSame(img)) { img = m; Refresh(); }}
|
||||
};
|
||||
|
||||
struct BarCtrl : public Ctrl {
|
||||
void LeftDouble(Point p, dword keyflags) override;
|
||||
};
|
||||
|
||||
One<FrameTop<Ctrl>> custom_bar_frame;
|
||||
One<FrameRight<Ctrl>> custom_bar_icons;
|
||||
One<Ctrl> custom_bar;
|
||||
One<BarCtrl> custom_bar;
|
||||
CustomBarIcon minicon, maxicon, closeicon;
|
||||
Color custom_titlebar_bk = SColorFace();
|
||||
int custom_titlebar_cy = -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue