Skip to content

Commit 1402dc9

Browse files
committed
feat: Rework.
1 parent e03a29f commit 1402dc9

File tree

200 files changed

+4643
-1184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+4643
-1184
lines changed

.flutter-plugins

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
# This is a generated file; do not edit or check into version control.
2-
handy_window=/home/youssef/.pub-cache/hosted/pub.dev/handy_window-0.2.1/
3-
screen_retriever=/home/youssef/.pub-cache/hosted/pub.dev/screen_retriever-0.1.4/
4-
window_manager=/home/youssef/.pub-cache/hosted/pub.dev/window_manager-0.3.0/
2+
app_links=/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/
3+
handy_window=/home/heygui/.pub-cache/hosted/pub.dev/handy_window-0.3.1/
4+
hotkey_manager=/home/heygui/.pub-cache/hosted/pub.dev/hotkey_manager-0.1.7/
5+
path_provider=/home/heygui/.pub-cache/hosted/pub.dev/path_provider-2.0.15/
6+
path_provider_android=/home/heygui/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/
7+
path_provider_foundation=/home/heygui/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.3/
8+
path_provider_linux=/home/heygui/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/
9+
path_provider_windows=/home/heygui/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/
10+
permission_handler=/home/heygui/.pub-cache/hosted/pub.dev/permission_handler-10.2.0/
11+
permission_handler_android=/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_android-10.2.1/
12+
permission_handler_apple=/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_apple-9.0.8/
13+
permission_handler_windows=/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_windows-0.1.2/
14+
screen_retriever=/home/heygui/.pub-cache/hosted/pub.dev/screen_retriever-0.1.6/
15+
window_manager=/home/heygui/.pub-cache/hosted/pub.dev/window_manager-0.3.4/

.flutter-plugins-dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[],"android":[],"macos":[{"name":"screen_retriever","path":"/home/youssef/.pub-cache/hosted/pub.dev/screen_retriever-0.1.4/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/youssef/.pub-cache/hosted/pub.dev/window_manager-0.3.0/","native_build":true,"dependencies":["screen_retriever"]}],"linux":[{"name":"handy_window","path":"/home/youssef/.pub-cache/hosted/pub.dev/handy_window-0.2.1/","native_build":true,"dependencies":[]},{"name":"screen_retriever","path":"/home/youssef/.pub-cache/hosted/pub.dev/screen_retriever-0.1.4/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/youssef/.pub-cache/hosted/pub.dev/window_manager-0.3.0/","native_build":true,"dependencies":["screen_retriever"]}],"windows":[{"name":"screen_retriever","path":"/home/youssef/.pub-cache/hosted/pub.dev/screen_retriever-0.1.4/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/youssef/.pub-cache/hosted/pub.dev/window_manager-0.3.0/","native_build":true,"dependencies":["screen_retriever"]}],"web":[]},"dependencyGraph":[{"name":"handy_window","dependencies":[]},{"name":"screen_retriever","dependencies":[]},{"name":"window_manager","dependencies":["screen_retriever"]}],"date_created":"2023-02-03 13:54:59.453508","version":"3.7.2-0.0.pre.1"}
1+
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_links","path":"/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/heygui/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"permission_handler_apple","path":"/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_apple-9.0.8/","native_build":true,"dependencies":[]}],"android":[{"name":"app_links","path":"/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/home/heygui/.pub-cache/hosted/pub.dev/path_provider_android-2.0.27/","native_build":true,"dependencies":[]},{"name":"permission_handler_android","path":"/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_android-10.2.1/","native_build":true,"dependencies":[]}],"macos":[{"name":"app_links","path":"/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/","native_build":true,"dependencies":[]},{"name":"hotkey_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/hotkey_manager-0.1.7/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/home/heygui/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.3/","shared_darwin_source":true,"native_build":true,"dependencies":[]},{"name":"screen_retriever","path":"/home/heygui/.pub-cache/hosted/pub.dev/screen_retriever-0.1.6/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/window_manager-0.3.4/","native_build":true,"dependencies":["screen_retriever"]}],"linux":[{"name":"handy_window","path":"/home/heygui/.pub-cache/hosted/pub.dev/handy_window-0.3.1/","native_build":true,"dependencies":[]},{"name":"hotkey_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/hotkey_manager-0.1.7/","native_build":true,"dependencies":[]},{"name":"path_provider_linux","path":"/home/heygui/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.11/","native_build":false,"dependencies":[]},{"name":"screen_retriever","path":"/home/heygui/.pub-cache/hosted/pub.dev/screen_retriever-0.1.6/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/window_manager-0.3.4/","native_build":true,"dependencies":["screen_retriever"]}],"windows":[{"name":"app_links","path":"/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/","native_build":true,"dependencies":[]},{"name":"hotkey_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/hotkey_manager-0.1.7/","native_build":true,"dependencies":[]},{"name":"path_provider_windows","path":"/home/heygui/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.6/","native_build":false,"dependencies":[]},{"name":"permission_handler_windows","path":"/home/heygui/.pub-cache/hosted/pub.dev/permission_handler_windows-0.1.2/","native_build":true,"dependencies":[]},{"name":"screen_retriever","path":"/home/heygui/.pub-cache/hosted/pub.dev/screen_retriever-0.1.6/","native_build":true,"dependencies":[]},{"name":"window_manager","path":"/home/heygui/.pub-cache/hosted/pub.dev/window_manager-0.3.4/","native_build":true,"dependencies":["screen_retriever"]}],"web":[{"name":"app_links","path":"/home/heygui/.pub-cache/hosted/pub.dev/app_links-3.4.3/","dependencies":[]}]},"dependencyGraph":[{"name":"app_links","dependencies":[]},{"name":"handy_window","dependencies":[]},{"name":"hotkey_manager","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"permission_handler","dependencies":["permission_handler_android","permission_handler_apple","permission_handler_windows"]},{"name":"permission_handler_android","dependencies":[]},{"name":"permission_handler_apple","dependencies":[]},{"name":"permission_handler_windows","dependencies":[]},{"name":"screen_retriever","dependencies":[]},{"name":"window_manager","dependencies":["screen_retriever"]}],"date_created":"2023-05-24 16:42:18.332466","version":"3.11.0-6.0.pre.19"}

LICENSE

Lines changed: 60 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Mozilla Public License Version 2.0
22
==================================
33

44
1. Definitions
5+
56
--------------
67

78
1.1. "Contributor"
@@ -84,7 +85,8 @@ Mozilla Public License Version 2.0
8485
ownership of such entity.
8586

8687
2. License Grants and Conditions
87-
--------------------------------
88+
89+
--------------
8890

8991
2.1. Grants
9092

@@ -155,7 +157,8 @@ Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155157
in Section 2.1.
156158

157159
3. Responsibilities
158-
-------------------
160+
161+
--------------
159162

160163
3.1. Distribution of Source Form
161164

@@ -217,7 +220,8 @@ disclaimers of warranty and limitations of liability specific to any
217220
jurisdiction.
218221

219222
4. Inability to Comply Due to Statute or Regulation
220-
---------------------------------------------------
223+
224+
--------------
221225

222226
If it is impossible for You to comply with any of the terms of this
223227
License with respect to some or all of the Covered Software due to
@@ -230,6 +234,7 @@ or regulation, such description must be sufficiently detailed for a
230234
recipient of ordinary skill to be able to understand it.
231235

232236
5. Termination
237+
233238
--------------
234239

235240
5.1. The rights granted under this License will terminate automatically
@@ -258,50 +263,55 @@ end user license agreements (excluding distributors and resellers) which
258263
have been validly granted by You or Your distributors under this License
259264
prior to termination shall survive termination.
260265

261-
************************************************************************
262-
* *
263-
* 6. Disclaimer of Warranty *
264-
* ------------------------- *
265-
* *
266-
* Covered Software is provided under this License on an "as is" *
267-
* basis, without warranty of any kind, either expressed, implied, or *
268-
* statutory, including, without limitation, warranties that the *
269-
* Covered Software is free of defects, merchantable, fit for a *
270-
* particular purpose or non-infringing. The entire risk as to the *
271-
* quality and performance of the Covered Software is with You. *
272-
* Should any Covered Software prove defective in any respect, You *
273-
* (not any Contributor) assume the cost of any necessary servicing, *
274-
* repair, or correction. This disclaimer of warranty constitutes an *
275-
* essential part of this License. No use of any Covered Software is *
276-
* authorized under this License except under this disclaimer. *
277-
* *
278-
************************************************************************
279-
280-
************************************************************************
281-
* *
282-
* 7. Limitation of Liability *
283-
* -------------------------- *
284-
* *
285-
* Under no circumstances and under no legal theory, whether tort *
286-
* (including negligence), contract, or otherwise, shall any *
287-
* Contributor, or anyone who distributes Covered Software as *
288-
* permitted above, be liable to You for any direct, indirect, *
289-
* special, incidental, or consequential damages of any character *
290-
* including, without limitation, damages for lost profits, loss of *
291-
* goodwill, work stoppage, computer failure or malfunction, or any *
292-
* and all other commercial damages or losses, even if such party *
293-
* shall have been informed of the possibility of such damages. This *
294-
* limitation of liability shall not apply to liability for death or *
295-
* personal injury resulting from such party's negligence to the *
296-
* extent applicable law prohibits such limitation. Some *
297-
* jurisdictions do not allow the exclusion or limitation of *
298-
* incidental or consequential damages, so this exclusion and *
299-
* limitation may not apply to You. *
300-
* *
301-
************************************************************************
266+
--------------
267+
268+
* *
269+
* 6. Disclaimer of Warranty *
270+
* ------------------------- *
271+
* *
272+
* Covered Software is provided under this License on an "as is" *
273+
* basis, without warranty of any kind, either expressed, implied, or *
274+
* statutory, including, without limitation, warranties that the *
275+
* Covered Software is free of defects, merchantable, fit for a *
276+
* particular purpose or non-infringing. The entire risk as to the *
277+
* quality and performance of the Covered Software is with You. *
278+
* Should any Covered Software prove defective in any respect, You *
279+
* (not any Contributor) assume the cost of any necessary servicing, *
280+
* repair, or correction. This disclaimer of warranty constitutes an *
281+
* essential part of this License. No use of any Covered Software is *
282+
* authorized under this License except under this disclaimer. *
283+
* *
284+
285+
--------------
286+
287+
--------------
288+
289+
* *
290+
* 7. Limitation of Liability *
291+
* -------------------------- *
292+
* *
293+
* Under no circumstances and under no legal theory, whether tort *
294+
* (including negligence), contract, or otherwise, shall any *
295+
* Contributor, or anyone who distributes Covered Software as *
296+
* permitted above, be liable to You for any direct, indirect, *
297+
* special, incidental, or consequential damages of any character *
298+
* including, without limitation, damages for lost profits, loss of *
299+
* goodwill, work stoppage, computer failure or malfunction, or any *
300+
* and all other commercial damages or losses, even if such party *
301+
* shall have been informed of the possibility of such damages. This *
302+
* limitation of liability shall not apply to liability for death or *
303+
* personal injury resulting from such party's negligence to the *
304+
* extent applicable law prohibits such limitation. Some *
305+
* jurisdictions do not allow the exclusion or limitation of *
306+
* incidental or consequential damages, so this exclusion and *
307+
* limitation may not apply to You. *
308+
* *
309+
310+
--------------
302311

303312
8. Litigation
304-
-------------
313+
314+
--------------
305315

306316
Any litigation relating to this License may be brought only in the
307317
courts of a jurisdiction where the defendant maintains its principal
@@ -311,7 +321,8 @@ Nothing in this Section shall prevent a party's ability to bring
311321
cross-claims or counter-claims.
312322

313323
9. Miscellaneous
314-
----------------
324+
325+
--------------
315326

316327
This License represents the complete agreement concerning the subject
317328
matter hereof. If any provision of this License is held to be
@@ -321,7 +332,8 @@ that the language of a contract shall be construed against the drafter
321332
shall not be used to construe this License against a Contributor.
322333

323334
10. Versions of the License
324-
---------------------------
335+
336+
--------------
325337

326338
10.1. New Versions
327339

@@ -357,7 +369,7 @@ Exhibit A - Source Code Form License Notice
357369

358370
This Source Code Form is subject to the terms of the Mozilla Public
359371
License, v. 2.0. If a copy of the MPL was not distributed with this
360-
file, You can obtain one at http://mozilla.org/MPL/2.0/.
372+
file, You can obtain one at <http://mozilla.org/MPL/2.0/>.
361373

362374
If it is not possible or desirable to put the notice in a particular
363375
file, then You may include the notice in a location (such as a LICENSE

README.md

Lines changed: 4 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,7 @@
1-
# GTK Window
2-
A package that add some missing gtk4 windowing features to flutter. Works for linux but it can also work for MacOS and Windows.
1+
# gtk_window
32

4-
[![pub package](https://img.shields.io/pub/v/gtk_window.svg)](https://pub.dev/packages/gtk_window)
5-
3+
This package is a fork and re-work of the awesome [gtk_window](https://github.com/YoussefLasheen/gtk_window) by Youssef Lasheen. The package has been re-worked for personal usage, and has diverged a lot from the original. Significant changes include re-positioning the buttons on MacOS (although it is not tested), adding color customizations, context menus, and other goodies.
64

7-
Before | After
8-
:-------------------------:|:-------------------------:
9-
![](https://raw.githubusercontent.com/YoussefLasheen/gtk_window/main/images/before_1.png) | ![](https://raw.githubusercontent.com/YoussefLasheen/gtk_window/main/images/after_1.png)
10-
![](https://raw.githubusercontent.com/YoussefLasheen/gtk_window/main/images/before_2.png) | ![](https://raw.githubusercontent.com/YoussefLasheen/gtk_window/main/images/after_2.png)
5+
## License
116

12-
13-
14-
## Features
15-
16-
- Window Command buttons like Maximize, Minimize, and Close
17-
- Back button when there's a view that can be poped
18-
- Custom leading and trailing widgets
19-
- PreferedSize bottom widgets
20-
- Light and Dark mode
21-
- Headerbar reacts to the window focus state
22-
- On window resize call allows you to add custom logic in reaction to the window resize
23-
- Curved corners (thanks to [handy_window](https://pub.dev/packages/handy_window))
24-
25-
## Getting started
26-
### Linux:
27-
28-
To get rounded corners move the two lines to the end of the my_application_activate class
29-
from:
30-
```cc
31-
gtk_window_set_default_size(window, 1280, 720);
32-
//gtk_widget_show(GTK_WIDGET(window));
33-
```
34-
```cc
35-
FlView* view = fl_view_new(project);
36-
//gtk_widget_show(GTK_WIDGET(view));
37-
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
38-
```
39-
40-
to:
41-
```cc
42-
static void my_application_activate(GApplication* application) {
43-
...
44-
45-
gtk_widget_show(GTK_WIDGET(window));
46-
gtk_widget_show(GTK_WIDGET(view));
47-
}
48-
```
49-
## Usage of GTKHeaderBar
50-
It's a drop in replacment for the AppBar widget. So It allows you to just replace the Material with it for desktop clients.
51-
### Basic title
52-
```dart
53-
import 'package:gtk_window/gtk_window.dart';
54-
Scaffold(
55-
appBar: GTKHeaderBar(
56-
middle: Text('example title'),
57-
),
58-
)
59-
```
60-
### Basic title with overflow hamburger menu:
61-
```dart
62-
import 'package:gtk_window/gtk_window.dart';
63-
Scaffold(
64-
appBar: GTKHeaderBar(
65-
middle: Text('example title'),
66-
trailing: ElevatedButton(
67-
child: Icon(child: Icons.menu,)
68-
),
69-
),
70-
)
71-
```
72-
### Basic title with search bottom:
73-
```dart
74-
import 'package:gtk_window/gtk_window.dart';
75-
Scaffold(
76-
appBar: GTKHeaderBar(
77-
middle: Text('Settings'),
78-
trailing: GTKButton(
79-
child: Icon(child: Icons.menu,)
80-
),
81-
bottom: PreferredSize(
82-
preferredSize: const Size.fromHeight(48),
83-
child: TextField()
84-
)
85-
),
86-
)
87-
```
88-
### Complicated split view with bottom search_bar:
89-
90-
Check out this [fork](https://github.com/YoussefLasheen/settings/tree/2fa2cc63f19e4a15b57be24974276b7962b97992)
91-
92-
![](https://raw.githubusercontent.com/YoussefLasheen/gtk_window/main/images/example_settings.png)
93-
94-
95-
## Current limitations
96-
- The OS doesn't treat the appbar natively so it can't be hidden in the case of using a window manager.
97-
- Currenlty right-clicking on the header does nothing.
98-
## Why not just use the native headerbar provided by flutter?
99-
Due to the wide array of supported platforms that the flutter team mantain, they have to bundle features together to work on as much platforms as they can to simplify development. So they made the GTK appbar version to be just like MacOS's and Windows' as they just hover over the content without having so muchcontrol over them. In GTK the appbar's can have lots of widgets contained in them, which without this package you would have no control over them.
100-
101-
## Disclaimer
102-
I not very profecient with GTK itself and every suggestion is welcome.
103-
104-
## Used plugins
105-
I actually didn't write any platform specific codes for this package. I relied on the amazing work done by handy_window and window_manager maintainers.
7+
The package maintains the original's package license which is MPL 2.0.

0 commit comments

Comments
 (0)