JetBrains style controls and UI for Compose Desktop

Overview

JetBrains UI Kit for Compose Desktop

JetBrains style controls and UI for Compose Desktop.

screenshot

Quick Start

1. Add dependency

dependencies {
    implementation(compose.desktop.currentOs) {
        exclude("org.jetbrains.compose.material")
    }
    implementation("com.bybutter.compose:compose-jetbrains-theme")
}

2. JBTheme DSL

fun main() = application {
    Window(
        onCloseRequest = ::exitApplication,
        title = "Compose for Desktop",
        state = rememberWindowState(width = 300.dp, height = 300.dp)
    ) {
        val count = remember { mutableStateOf(0) }

        JBTheme {
            JPanel(Modifier.fillMaxSize().jBorder(top = 1.dp, color = JBTheme.panelColors.border)) {
                Column(Modifier.fillMaxSize(), Arrangement.spacedBy(5.dp)) {
                    Button(modifier = Modifier.align(Alignment.CenterHorizontally),
                        onClick = {
                            count.value++
                        }) {
                        Text(if (count.value == 0) "Hello World" else "Clicked ${count.value}!")
                    }
                    Button(modifier = Modifier.align(Alignment.CenterHorizontally),
                        onClick = {
                            count.value = 0
                        }) {
                        Text("Reset")
                    }
                }
            }
        }
    }
}
Comments
  • Allow passing in `undecorated` and `transparent` arguments to `JBWindow` function

    Allow passing in `undecorated` and `transparent` arguments to `JBWindow` function

    Currently the undecorated and transparent arguments of the Window function are hard-coded to be set to false, it would be nice if instead the JBWindow function would allow one to define the undecorated and transparent arguments.

    Having undecorated and transparent set to true does not seem to cause any issues, at least on Windows, from my testing.

    Along with this, it would be nice if some way of wrapping the MainToolBar in a DraggableWindowArea was provided, most likely a separate JBWindow function would be the best solution. This would allow one to have a custom tool bar with drag functionality without needing to use the JetBrains Runtime, which might not be possible to use in a project.

    It is possible to achieve this with the current functions provided, but it would essentially result in a re-implementation of the entire JBWindow system, which feels like a waste of time and resources when the system is already implemented and would only require some small tweaks to allow the desired functionality.

    enhancement 
    opened by Olivki 6
  • `WindowState.placement` action button in `MainToolBar` still shown when `resizable` is `false`

    `WindowState.placement` action button in `MainToolBar` still shown when `resizable` is `false`

    When resizable in JBWindow is false I expected the minimize/maximize button to be hidden, as minimizing/maximizing a window is a resizing operation. Currently that button is still there even if resizable is false.

    Hiding the minimize/maximize if a window isn't resizable is at least the default behavior on Windows, unsure about other systems.

    Only tested on Windows 10.

    bug 
    opened by Olivki 3
  • Toolbar in new UI is not applying JBR patches when it has no children

    Toolbar in new UI is not applying JBR patches when it has no children

    In the new UI sample, on JBR, if you remove the title and content from the main toolbar, it renders incorrectly (below the system chrome instead of replacing it):

    image

    It should render the custom title bar correctly even when it has no title and no content

    bug 
    opened by rock3r 2
  • Build the project with Java 11

    Build the project with Java 11

    Currently the project is building with Java 16 which makes kinda impossible of using it on a IntelliJ plugin

    https://github.com/ButterCam/compose-jetbrains-theme/blob/main/build.gradle.kts#L39

    opened by DevSrSouza 2
  • io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams addToActiveStreams SEVERE: Caught Throwable from listener onStreamActive.

    io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams addToActiveStreams SEVERE: Caught Throwable from listener onStreamActive.

    I don't know why, but my grpc request does not work through the proxy.

    Nov 09, 2021 10:59:44 AM io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams addToActiveStreams
    SEVERE: Caught Throwable from listener onStreamActive.
    java.lang.AssertionError
    	at io.netty.handler.codec.http2.DefaultHttp2LocalFlowController$DefaultState.window(DefaultHttp2LocalFlowController.java:364)
    	at io.netty.handler.codec.http2.DefaultHttp2LocalFlowController$DefaultState.<init>(DefaultHttp2LocalFlowController.java:358)
    	at io.netty.handler.codec.http2.DefaultHttp2LocalFlowController$1.onStreamActive(DefaultHttp2LocalFlowController.java:101)
    	at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.addToActiveStreams(DefaultHttp2Connection.java:991)
    	at io.netty.handler.codec.http2.DefaultHttp2Connection$ActiveStreams.activate(DefaultHttp2Connection.java:946)
    	at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultStream.activate(DefaultHttp2Connection.java:501)
    	at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:757)
    	at io.netty.handler.codec.http2.DefaultHttp2Connection$DefaultEndpoint.createStream(DefaultHttp2Connection.java:668)
    	at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders0(DefaultHttp2ConnectionEncoder.java:201)
    	at io.netty.handler.codec.http2.DefaultHttp2ConnectionEncoder.writeHeaders(DefaultHttp2ConnectionEncoder.java:167)
    	at io.kanro.mediator.proxy.http2.Http2GrpcServerHandler.onHeadersRead(Http2GrpcServerHandler.kt:91)
    
    opened by juwens 1
  • Had issue building the desktop module

    Had issue building the desktop module

    Could not resolve com.bybutter.compose:compose-jetbrains-theme:1.0.
    Required by:
        project :desktop
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
    
    Execution failed for task ':desktop:compileKotlin'.
    > Error while evaluating property 'filteredArgumentsMap' of task ':desktop:compileKotlin'
       > Could not resolve all files for configuration ':desktop:compileClasspath'.
          > Could not resolve com.bybutter.compose:compose-jetbrains-theme:1.0.
            Required by:
                project :desktop
             > No matching variant of com.bybutter.compose:compose-jetbrains-theme:1.0 was found. The consumer was configured to find an API of a library compatible with Java 8, preferably in the form of class files, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' but:
                 - Variant 'apiElements' capability com.bybutter.compose:compose-jetbrains-theme:1.0 declares an API of a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 8
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                 - Variant 'javadocElements' capability com.bybutter.compose:compose-jetbrains-theme:1.0 declares a runtime of a component, and its dependencies declared externally:
                     - Incompatible because this component declares documentation and the consumer needed a library
                     - Other compatible attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                         - Doesn't say anything about its target Java version (required compatibility with Java 8)
                         - Doesn't say anything about its elements (required them preferably in the form of class files)
                         - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
                 - Variant 'runtimeElements' capability com.bybutter.compose:compose-jetbrains-theme:1.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm':
                     - Incompatible because this component declares a component compatible with Java 16 and the consumer needed a component compatible with Java 8
                     - Other compatible attribute:
                         - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                 - Variant 'sourcesElements' capability com.bybutter.compose:compose-jetbrains-theme:1.0 declares a runtime of a component, and its dependencies declared externally:
                     - Incompatible because this component declares documentation and the consumer needed a library
                     - Other compatible attributes:
                         - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                         - Doesn't say anything about its target Java version (required compatibility with Java 8)
                         - Doesn't say anything about its elements (required them preferably in the form of class files)
                         - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'jvm')
    
    
    opened by juwens 1
  • :sparkles: JetBrains ExpUI theme

    :sparkles: JetBrains ExpUI theme

    Platform

    • [x] MacOS
    • [x] Windows
    • [x] Linux

    Theme

    • [x] LightTheme
    • [x] DarkTheme

    Control

    • [x] ActionButton
    • [x] Button
    • [x] Label
    • [x] Link
    • [x] TextField
    • [x] TextArea
    • [x] CheckBox
    • [x] RadioButton
    • [x] SegmentedButton
    • [x] ComboBox
    • [x] ContextMenu
    • [x] DropdownMenu
    • [x] ProgressBar
    • [x] Tab

    Gallery

    • [ ] Generic
    • [ ] Text
    • [ ] Tabs
    • [ ] Menus

    Screenshot

    MacOS

    截屏2022-11-21 17 11 56 截屏2022-11-21 17 12 18

    Windows

    image
    image

    Linux(Ubuntu with Gnome)

    image image

    opened by devkanro 0
  • Replacing SVG Resources with Compose generated Image Vectors

    Replacing SVG Resources with Compose generated Image Vectors

    This PR uses svg-to-compose to generate SVG resources into Compose Vector source. The main reason here is that when using the library on a IntelliJ plugin, any component that uses the svg resource crashes, for example, checkbox.

    In the future, compose-icons will contain also Jetbrains AllIcons set, then, this source will not be necessary.

    opened by DevSrSouza 0
Releases(v2.1.0)
Owner
null
A Jetbrains Compose Desktop application for interacting with adb

ADB Tool A Compose Desktop application for managing Android devices via ADB. This is currently a work in progress and subject to change over time. Fea

Drew Heavner 2 Jul 1, 2022
Test-compose-for-desktop - Hello World in Compose for Desktop

Testing Run from command line: ./gradlew run Regular build: ./gradlew packageUb

Sebastian 3 Sep 20, 2022
Snake-compose-for-desktop - Snake Game - implemented using Compose for Desktop

A Snake game, built with Compose for Desktop snake-compose-for-desktop is my imp

gnu 5 Feb 17, 2022
A desktop code editor app using Jetpack Compose for Desktop and IntelliJ Platform

Compose Code Editor A desktop code editor app using Jetpack Compose for Desktop and IntelliJ Platform. Project Structure The code is contained in the

Alex 73 Dec 19, 2022
💻 A cross-platform desktop application to identify libraries used inside an android application. Made possible by Compose Desktop ⚡

?? stackzy A desktop app to analyse APK. Built using Compose desktop ✨ Demo Watch demo ??️ Usage Show usage ?? Install Platform Download Status Linux

theapache64 876 Dec 24, 2022
Jetbrains Compose - Stock Watchlist

watchlist-compose Jetbrains Compose - Stock Watchlist Start APP Create API Key at alphavantage.co Set OS Environment Variable 'ALPHAVANTAGE_APIKEY' to

Luca Nerlich 0 Dec 23, 2022
A project generator using Compose by JetBrains with a GUI

GradleProjectGenerator A project generator using Compose by JetBrains with a GUI

Francisco Solis 0 Dec 19, 2021
Exercising Compose for Desktop and Compose for Web (Canvas)

Compose Counting Grid A simple application to check Compose for Desktop and Compose for Web (Canvas) drawing speeds when drawing grids (or tables) wit

null 6 Nov 11, 2022
Jetpack Compose Boids | Flocking Insect 🐜. bird or Fish simulation using Jetpack Compose Desktop 🚀, using Canvas API 🎨

?? ?? ?? Compose flocking Ants(boids) ?? ?? ?? Jetpack compose Boids | Flocking Insect. bird or Fish simulation using Jetpack Compose Desktop ?? , usi

Chetan Gupta 38 Sep 25, 2022
New style for app design and Movies App with Movies API JetMaxMovies made in Jetpack Compose.😉😎

JetMaxMovie New style for app design and Movies App with Movies API JetMaxMovies made in Jetpack Compose. ?? ?? (Navigation Compose,Dagger-Hilt, Mater

Arvind Meshram 6 Jul 6, 2022
New style for app design Online Flora Go Go App UI made in Jetpack Compose. 😉 😎

JetComposeLoginUI New style for app design Online Flora Go Go App UI made in Jetpack Compose. ?? ?? (Navigation Components, Dagger-Hilt, Material Comp

Arvind Meshram 95 Dec 22, 2022
New style for app design E-commerce Shop App UI made in Jetpack Compose.😉😎

E-commerceShopAppUI-Android New style for app design E-commerce Shop App UI made in Jetpack Compose. ?? ?? (Navigation Components, Dagger-Hilt, Materi

Arvind Meshram 30 Jan 8, 2023
How to use Jetpack Compose’s theming APIs to style your application

Jetpack Compose Theming Codelab This folder contains the source code for the Jetpack Compose Theming codelab. In this codelab you will learn how to us

David Merino 0 Oct 7, 2021
⌨️ A tool that gives you a massive head start when building Compose Desktop apps. It saves you from time-consuming setup and configuration

?? create-compose-app A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configur

theapache64 466 Dec 21, 2022
💻 A Compose Desktop project template with MVVM, Dagger, Decompose, tests, and more...

compose-desktop-template A compose desktop project template with MVVM, Dagger, Decompose and more ✨ Demo What's included? Architecture (MVVM) with And

theapache64 73 Dec 21, 2022
⌨️ A tool that gives you a massive head start when building Compose Desktop apps. It saves you from time-consuming setup and configuration

?? create-compose-app A tool that gives you a massive head start when building Compose based apps. It saves you from time-consuming setup and configur

theapache64 468 Dec 30, 2022
Resume of Louis CAD, made with Jetpack Compose. Supports the Web, Desktop, and Android.

ResumeComposition What This project is the source code of the resume/CV of Louis CAD. The latest PDF export is available here, it is ready to print. H

Louis CAD 22 Aug 14, 2022
A compose desktop project template with MVVM, Dagger, Decompose and more

compose-desktop-template A compose desktop project template with MVVM, Dagger, D

null 2 Jan 27, 2022
Welcome Fruit Ninja 🥝 on Jetpack Compose Desktop 🚀, using Canvas API 🎨

Compose-Fruit-Ninja ?? Welcome Fruit Ninja on Jetpack Compose Desktop ?? , using Canvas API ?? Featured on jetc-dev How to Run From gradle tab from ri

Chetan Gupta 54 Nov 2, 2022