Giter Site home page Giter Site logo

zeveisenberg / adwaita-swift Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aparokshaui/adwaita-swift

0.0 1.0 0.0 2.72 MB

A framework for creating user interfaces for GNOME with an API similar to SwiftUI

Home Page: https://david-swift.gitbook.io/adwaita/

License: MIT License

C 0.16% Swift 99.82% Makefile 0.02%

adwaita-swift's Introduction

Adwaita Icon

Adwaita for Swift

User Manual · GitHub · Contributor Docs

Adwaita is a framework for creating user interfaces for GNOME with an API similar to SwiftUI.

The following code:

struct Example: View {

    @State private var count = 0

    var view: Body {
        Text("\(count)")
            .style("title-1")
            .padding(50)
            .topToolbar {
                HeaderBar.start {
                    Button(icon: .default(icon: .goPrevious)) {
                        count -= 1
                    }
                    Button(icon: .default(icon: .goNext)) {
                        count += 1
                    }
                }
            }
    }

}

Creates a simple counter view:

Counter Example

More examples are available in the demo app:

Demo App

Table of Contents

Goals

Adwaita’s main goal is to provide an easy-to-use interface for creating GNOME apps. The backend should stay as simple as possible, while not limiting the possibilities there are with Libadwaita and GTK.

If you want to use Adwaita in a project, but there are widgets missing, open an issue on GitHub.

Find more information about the project's motivation in this blog post.

Widgets

An overview of the widgets supported by Adwaita is available here.

Installation

Dependencies

Flatpak

It is recommended to develop apps inside of a Flatpak. That way, you don't have to install Swift or any of the dependencies on your system, and you always have access to the latest versions. Take a look at the template repository. This works on Linux only.

Directly on System

You can also run your apps directly on the system.

If you are using a Linux distribution, install libadwaita-devel or libadwaita (or something similar, based on the package manager) as well as gtk4-devel, gtk4 or similar.

On macOS, follow these steps:

  1. Install Homebrew.
  2. Install Libadwaita (and thereby GTK 4):
brew install libadwaita

Swift Package

  1. Open your Swift package in GNOME Builder, Xcode, or any other IDE.
  2. Open the Package.swift file.
  3. Into the Package initializer, under dependencies, paste:
.package(url: "https://github.com/AparokshaUI/Adwaita", from: "0.1.0")   

Usage

I recommend using the template repository as a starting point.

Basics

Advanced

Information

Thanks

Dependencies

Other Thanks

adwaita-swift's People

Contributors

david-swift avatar gregcotten avatar

Watchers

 avatar

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.