Code Monkey home page Code Monkey logo

gioview's Introduction

Gio-view: A Toolkit for Faster Gio App Development

Gio-view is a third-party toolkit that simplifies building user interfaces (UIs) for desktop applications written with the Gio library in Go. It provides pre-built components and widgets, saving you time and effort compared to creating everything from scratch. Gio-view offers a more user-friendly experience for developers new to Gio.

A significant portion of the Gio-view codebase originates from the Fernnote project (https://fernnote.vip/). If you're interested in seeing a practical example of Gio-view, Fernnote is a good starting point.

Features:

  • View Manager: Manages the lifecycle of your views and handles user interactions between them.
  • Pre-built Widgets: Includes components like editors, image viewers, lists, menus, navigation drawers, tab bars, and more.
  • Built-in Theme: Provides a starting point for your app's visual design.
  • Custom Font Loader: Allows you to easily integrate custom fonts into your UI.

Benefits:

  • Faster Development: Get started building UIs quicker with pre-built components.
  • Reduced Boilerplate: Focus on app logic instead of writing low-level UI code.
  • Improved Developer Experience: Provides a more user-friendly approach for building Gio applications.

Getting Started:

For detailed information on using Gio-view, refer to the project's documentation: godoc

Examples:

Gio-view offers an example demonstrating its features. Clone the repository and run it from the "example" directory for a hands-on exploration.

Screenshots of the example:

image & tabview modal view

Caveats:

  • Desktop Focus: Currently, Gio-view primarily targets desktop applications. While Gio itself is cross-platform, some styling adjustments might be needed for mobile UIs.
  • Limited Customization: Out-of-the-box styles might not offer complete design flexibility.

Contributing

Feel free to contribute by filing issues or creating pull requests to improve Gio-view.

License

This project is licensed under the MIT License.

gioview's People

Contributors

oligo avatar mirzakhany avatar gedw99 avatar

Stargazers

 avatar Matthew Henry avatar  avatar Jonathan Scherrer avatar  avatar ik5 avatar Yogensia avatar Penn avatar colorcrow avatar sffxzzp avatar Tomás Weigenast avatar Gábor Nagymajtényi avatar yehun avatar ifzz avatar ggymm avatar letgo avatar Marcin Maluszczak avatar  avatar ctracerpp avatar Vlad Oros avatar Sevenate avatar Brad Pillow avatar  avatar Tom avatar Lennart Martens avatar EDGE avatar Florian Thienel avatar  avatar  avatar Daniil Zuev avatar  avatar  avatar rydzgzn avatar Rangding Zhang avatar jiajia avatar  avatar SeniorPlayer avatar  avatar  avatar 忙巳 avatar  avatar  avatar Sevdalin Sabev avatar xiusin avatar void avatar Bogdan Dinu avatar Taylour Christian Daniels avatar ginuerzh avatar  avatar Joshua Rich avatar github user avatar Roman Nestertsov avatar Zach Russell avatar Raffaele Sena avatar  avatar

Watchers

Tobias Gesellchen avatar likon avatar  avatar  avatar

gioview's Issues

Add build automation

So we can do build automation.

taskfile or makefile or magefile.

magefile is probably better for this type of project .

gio cmd to build for :
desktop
Mobile
Web

—-

Deploy folder with the scaffolds for each , so the binary just needs to be dropped inside .

—-

GitHub workflow to build

—-

Release to github releases.

Client update via nats subscription , which uses nats object store . The nats object store handler listens for the GitHub web hook ( if we want full round trip git ops) or the nats cli can push the binary in for dev testing :)

use dev and prod environment distinctions .

Editor syntax highlighting example panics on a bad regular expression pattern.

The following makes it not panic, but it is not an ideal fix.
bogen85@26fc3cc

Basically just called regex.Compile and checked for and logged the error instead of calling regex.MustCompile.

Since error/pattern state is not being tracked, logging of error repeats until the pattern is corrected.

Oh, by the way, kind of a separate issue, but the 2 files had different white-space settings from your repo, one with spaces, one with tabs, so go fmt broke things and had to tell my editor the differences from the Go defaults. (Which is tabs, not spaces). The inconsistencies are going to make pull requests harder.

Want to discuss how the error should be handled for your example (having the example panic is not ideal) before I make a PR.

Paint Selection when editor is focused

Hi,
As result of flowing change in editor widget, user can have more one selected text if have more than one editor in the same view. its not a logical issue but can cause UX problems. I did test to revert this change and editor still works with no issue so I was wondering if we can remove it?

	// comment below code to ensure selected text is highlighted when editor menu poped up.
	// if !gtx.Focused(e) {
	// 	return
	// }

Screen Shot:

Screenshot 2024-08-03 at 19 46 59

Syntax Highlighting in Editor

Hi @oligo
First of all thanks for your great work on this package, its looks really good.
I have developed an API Client with gio ui, Chapar and from very beginning one of my concerns was syntax highlighting for JSON and soon for python codes.

That being said I would like to have your review on the PR I made in Chapar which is using gioview editor to enable syntax highlighting. your feedback is very much appreciated.

Thanks again
Mohsen

Nats Jetstream example

Add a simple example for data and images using NATS Jetstream.

this will automatically make the example do real time sync between all users using the app. When an image or data changes all users will get the change either online ( instantly ) or offline ( when they go back on line , it will push the message updates they missed ).

A nats leaf server can be embedded for full offline editing and sync. https://docs.nats.io/running-a-nats-service/configuration/leafnodes/jetstream_leafnodes explains it.

migrations:

Stare is stored on the NATS server.

if the data types change then the data stored in NATS must be migrated.

The typical solution to this is to use protobufs for data.

For images it’s fine because they are just binary , but we should sniff the image type and switch in the code .

web:

gio supports WASM and so does nats.go. So web works fine too

Crash when type `shift+=` in Editor Example

2024/06/04 22:15:25 loaded builtin font face: Go, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go, style: Italic, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go, style: Regular, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go, style: Italic, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Medium, style: Regular, weight: Medium
2024/06/04 22:15:25 loaded builtin font face: Go Medium, style: Italic, weight: Medium
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Regular, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Italic, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Italic, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Smallcaps, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Smallcaps, style: Italic, weight: Normal
2024/06/04 22:15:25 registered view:  main/Example
2024/06/04 22:15:25 registered view:  main/EditorExampleView
2024/06/04 22:15:29 switching to gioview://main/EditorExampleView
panic: regexp: Compile("6ijd|\n_++"): error parsing regexp: invalid nested repetition operator: `++`

goroutine 6 [running]:
regexp.MustCompile({0xc0020f7a30, 0x9})
        A:/Scoop/apps/go/current/src/regexp/regexp.go:317 +0xb4
main.stylingText({0xc002247a00, 0x190}, {0xc0020f7a30?, 0x0?})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:110 +0x3d
main.(*EditorExample).Layout.func1.3({{{0x357, 0x0}, {0x357, 0xf4169}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:76 +0x107
gioui.org/layout.Flex.Layout({0x0?, 0x0?, 0x0?, 0x0?}, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/layout/flex.go:99 +0x2b5
main.(*EditorExample).Layout.func1({{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:48 +0x3f7
gioui.org/layout.Inset.Layout({0x5826ac0?, 0xc0?, 0xdfdeb8?, 0x0?}, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/layout/layout.go:169 +0x3a3
github.com/oligo/gioview/page.(*PageStyle).Layout.func1({{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/page/page_style.go:71 +0x65
gioui.org/layout.(*List).Layout(0xc005948e50, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/layout/list.go:122 +0x158
gioui.org/widget/material.ListStyle.Layout({0xc005948e08, {0xc005948e08, {0x40000000, 0x40000000, {0x0, 0x0, 0x0, 0x0}}, {0x42180000, 0x40c00000, ...}}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/widget/material/list.go:286 +0x208
github.com/oligo/gioview/page.(*PageStyle).Layout(0xc000101810, {{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/page/page_style.go:67 +0x645
main.(*EditorExample).Layout(0x0?, {{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:44 +0xb1
main.(*HomeView).LayoutMain.func2.3({{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:79 +0x9d
gioui.org/layout.Flex.Layout({0x1e?, 0x0?, 0x0?, 0x0?}, {{{0x366, 0x384}, {0x366, 0x384}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/layout/flex.go:134 +0x635
main.(*HomeView).LayoutMain.func2({{{0x366, 0x384}, {0x366, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:66 +0x3e5
gioui.org/layout.Flex.Layout({0x40?, 0xe8?, 0x7f?, 0xc0?}, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/pkg/mod/[email protected]/layout/flex.go:134 +0x635
main.(*HomeView).LayoutMain(0xc0033988d0, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:41 +0x23d
main.(*HomeView).Layout(...)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:34
main.(*UI).layout(0xc0000e8b00?, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...})
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:48 +0xdb
main.(*UI).Loop(0xc005827fb8)
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:37 +0x1a5
main.main.func1()
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:61 +0x86
created by main.main in goroutine 1
        C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:54 +0x1a
exit status 2

Feature Request: Lines number in editor?

Hi
I hope this message finds you well. I am currently using the Gioview editor to develop a simple code editor within Chapar. I believe that adding a feature to render line numbers would greatly enhance the usability of the editor.

Would it be possible to introduce an option to enable line numbers in the editor settings?
Thank you for considering my request. I appreciate your hard work on this excellent tool.

Best regards,
Mohsen

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.