Git Product home page Git Product logo

Comments (18)

Zren avatar Zren commented on September 18, 2024 5

I've merged this feature and titlebar alignment to the master branch.

screen-2021-02-09_17.33.06.mp4

from material-decoration.

Zren avatar Zren commented on September 18, 2024 4

The menuonhover branch has this feature. I now need to add a config option.

I need to figure out how I want to handle the caption. It currently "dodges" the menu which isn't needed when the menu is hidden.

I should probably do a comprehensive alignment option like Breeze.

  • Left/Center/Right
  • Center [between left/right buttons]
  • Center (Full Width) [true center of window]
  • Center (Full Width + Dodge Menu) [current MaterialDecoration behavior]

from material-decoration.

Zren avatar Zren commented on September 18, 2024 3

Hmm. According to the Unity video https://youtu.be/nzFXRz-b3Ns?t=40

  • Captions are left aligned
  • Menu doesn't appear when hovered until the window is focused
  • The title completely disappears, theres' no gradient (at least not in Ubuntu 14.04).

from material-decoration.

mojtaba82 avatar mojtaba82 commented on September 18, 2024 1

@nicman23

hey adding to this, could we have the title of the window instead of empty space?
so on no hover -> title
on hover -> menu

I implement this feature you want. you can compile and test it.
https://github.com/mojtaba82/material-decoration

from material-decoration.

Zren avatar Zren commented on September 18, 2024 1

Thanks for reporting the bug @nicman23. I fixed that bug and made the titlebar repaint when toggling always show.

from material-decoration.

mojtaba82 avatar mojtaba82 commented on September 18, 2024 1

To reproduce it, you need to click at points sit at the lower-half part of buttons...
image

I cinfirm this.

from material-decoration.

Zren avatar Zren commented on September 18, 2024

I already have background opacity animations, so making a reveal on hover animation isn't too difficult. The hard part is having the entire menu drawn in sync as the current bg hover animation is per button. I will need another QAnimation, probably in AppMenuButtonGroup. I'll also need to rename the existing opacity property to backgroundOpacity, or hoverTween as the foreground color was also mixed on hover.

This code snippet will make all buttons transparent, and reveal just 1 button on hover.

QColor AppMenuButton::foregroundColor() const
{
    // ...
    } else {
        QColor hoverColor = Button::foregroundColor();
        QColor normalColor = QColor(hoverColor);
        normalColor.setAlphaF(0);

        return KColorUtils::mix(
            normalColor,
            hoverColor,
            opacity());
    }
}

I also need to determine if the menu should be revealed if the caption area is hovered, or if anywhere in the titlebar is hovered. If the latter, then the hover events need to be handled in Decoration. I can still keep the new opacity property in AppMenuButtonGroup though.

from material-decoration.

nicman23 avatar nicman23 commented on September 18, 2024

can we have this without any animation?

from material-decoration.

vosian avatar vosian commented on September 18, 2024

I'm also interested on this, even without animations

from material-decoration.

mojtaba82 avatar mojtaba82 commented on September 18, 2024

I fork this nice decoration. and add a branch named captionmenufeatcher and merge caption and menu like unity lim.
It work but I'm not professional in programming. I would be glad if you test it.
Thanks

from material-decoration.

nicman23 avatar nicman23 commented on September 18, 2024

hey adding to this, could we have the title of the window instead of empty space?

so on no hover -> title

on hover -> menu

from material-decoration.

Zren avatar Zren commented on September 18, 2024
  • Caption will now hide on hover, and it's position ignores the space taken up by the menu.
  • There's now a toggle in the config.
    • I used a hack to treat the "checkbox" as 2 radio buttons so that the on/off state has descriptive labels.
    • I need to bind the config toggle to redraw the menu.

from material-decoration.

nicman23 avatar nicman23 commented on September 18, 2024

small bug report, the menu is visible on window creation not the title

from material-decoration.

trmdi avatar trmdi commented on September 18, 2024

Is this a related bug?

vokoscreenNG-2021-02-18_23-15-49.mp4

from material-decoration.

mojtaba82 avatar mojtaba82 commented on September 18, 2024

I have same problem occasionally.

from material-decoration.

Zren avatar Zren commented on September 18, 2024

The hover animation isn't checking if the menu is open atm. I did experience that once, but it rarely happens with Breeze's contextmenu.

Looks like I need to check (m_currentIndex != -1) in the updateOpacity func.

setOpacity(m_alwaysShow || m_hovered ? 1 : 0);

from material-decoration.

trmdi avatar trmdi commented on September 18, 2024

To reproduce it, you need to click at points sit at the lower-half part of buttons...
image

from material-decoration.

Zren avatar Zren commented on September 18, 2024

Should be fixed with d026781 and 8873774.

Thanks @trmdi for your PR #34. I expanded on it to add a bool showing property which represents the alwaysShow || hovered || isMenuOpen().

from material-decoration.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.