Code Monkey home page Code Monkey logo

framelesswindow's Introduction

FramelessWindow

A frameless window / title bar written in C++ and built for Qt projects.

The design is loosely based on CustomWindow.

However, resizing and other methods are implemented through Qt::WA_Hover or QHoverEvent instead of mouse move related events.

Features

  • Minimize
  • Maximize and restore
  • Close
  • Roll up and roll down
  • Move support
  • Menubar support
  • Resizing from all corners
  • Resizing from all edges
  • Fullscreen mode
  • Works on Qt 6 and above
  • Edgehit handling(kinda messy)

Style

The frameless window consists of a title bar, central widget and bottom bar, all inheriting QWidget within various layouts(ui).

The look and feel of the window is derived from the "framelesswindow.css" file, mostly pointing towards a dark theme.

Documentation

The frameless window class and its methods have been clearly documented in the "framelesswindow.h" header file with doxygen format. A PDF file is also provided in docs directory.

Examples

An example on handling a QMainWindow/QWidget with menubar is provided in the example folder.

Demo

Here are some videos of frameless window running on several Qt supported systems:

On Windows 11

framelessdemo.mp4

On Ubuntu 21.10

framelessdemoubuntu.mp4

macOS(not tested yet)

If anyone possibly tested it on mac, open an issue here in the repo with a demo video, providing any insights on issues if faced. Please also include necessary details like version information, etc.

framelesswindow's People

Contributors

i0re avatar yet-zio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

framelesswindow's Issues

How to set the style of other controls

First of all, thank you for your open source. I just learned Qt not long ago. I ran your test example and the effect was great. But I encountered a problem. I wanted to set up QSS for more ui controls. But when I use

ui->setupUi(this);
QFile file(":/darkstyle.qss");
if (file.open(QFile::ReadOnly)) {
QString styleSheet = QLatin1String(file.readAll());
setStyleSheet(styleSheet); // Set the read content as the global style sheet
file.close();
}```, 

comment out
setStyleSheet(".MainWindow{"
"background-color: #616161;"
"}"); 
The main body of the window is transparent. 
I don't know how I should modify it, 
because your example only has one way to change the 
style of a PUSHBUTTON. If you change it one by one, 
this is definitely not good. If you can, I hope you can 
Give me some tips.

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.