Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new composer #623

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions data/gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-markdown-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-rich-text-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-earth-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-bear-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-image-round-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-sentiment-satisfied-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-verified-checkmark-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-funnel-symbolic.svg</file>
<file preprocess="xml-stripblanks">icons/scalable/actions/tuba-error-symbolic.svg</file>
Expand Down Expand Up @@ -88,6 +91,7 @@
<file>ui/dialogs/list_edit.ui</file>
<file>ui/dialogs/new_account.ui</file>
<file>ui/dialogs/compose.ui</file>
<file>ui/dialogs/new_composer.ui</file>
<file>ui/dialogs/main.ui</file>
<file>ui/dialogs/preferences.ui</file>
<file>ui/dialogs/profile_edit.ui</file>
Expand Down
31 changes: 23 additions & 8 deletions data/gtk/dropdown/icon.ui
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
<interface>
<template class="GtkListItem">
<property name="child">

<object class="GtkImage">
<binding name="icon_name">
<lookup name="icon_name" type="TubaInstanceAccountVisibility">
<lookup name="item">GtkListItem</lookup>
</lookup>
</binding>
<object class="GtkBox">
<property name="orientation">horizontal</property>
<property name="spacing">6</property>
<child>
<object class="GtkImage">
<binding name="icon_name">
<lookup name="icon_name" type="TubaInstanceAccountVisibility">
<lookup name="item">GtkListItem</lookup>
</lookup>
</binding>
</object>
</child>
<child>
<object class="GtkLabel">
<property name="xalign">0</property>
<property name="ellipsize">end</property>
<binding name="label">
<lookup name="name" type="TubaInstanceAccountVisibility">
<lookup name="item">GtkListItem</lookup>
</lookup>
</binding>
</object>
</child>
</object>

<!-- <object class="GtkLabel"> -->
Expand Down Expand Up @@ -42,4 +58,3 @@
</property>
</template>
</interface>

2 changes: 2 additions & 0 deletions data/icons/scalable/actions/tuba-bear-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions data/icons/scalable/actions/tuba-image-round-symbolic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions data/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,18 @@ GtkSourceAssistant row:last-child {
font-size: small;
}

.accented-color {
color: @accent_color;
}

.font-large {
font-size: large;
}

.dropdown-border-radius > button {
border-radius: 9999px;
}

.filter {
margin: -2px;
border-radius: 0;
Expand Down
163 changes: 163 additions & 0 deletions data/ui/dialogs/new_composer.ui
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk" version="4.0" />
<requires lib="Adw" version="1.0" />
<template class="TubaDialogsNewCompose" parent="AdwDialog">
<property name="content_width">500</property>
<property name="content_height">400</property>
<property name="width_request">360</property>
<property name="height_request">200</property>
<child>
<object class="AdwToolbarView">
<child type="top">
<object class="AdwHeaderBar">
<property name="show-title">0</property>
</object>
</child>
<property name="content">
<object class="GtkScrolledWindow">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
<property name="max-content-height">400</property>
<child>
<object class="AdwClamp">
<property name="valign">start</property>
<property name="tightening-threshold">100</property>
<child>
<object class="GtkBox" id="status_box">
<property name="orientation">vertical</property>
<property name="vexpand">1</property>
<property name="valign">start</property>
<property name="spacing">30</property>
<child>
<object class="GtkLabel" id="status_title">
<property name="label" translatable="yes">New Post</property>
<property name="wrap">1</property>
<property name="wrap-mode">word-char</property>
<property name="justify">center</property>
<style>
<class name="title-1" />
</style>
</object>
</child>
<child>
<object class="GtkBox" id="main_box">
<property name="vexpand">1</property>
<property name="orientation">vertical</property>
</object>
</child>
</object>
</child>
</object>
</child>
</object>
</property>
<child type="bottom">
<object class="GtkGrid" id="grid">
<property name="margin-top">20</property>
<property name="margin-start">32</property>
<property name="margin-end">32</property>
<property name="margin-bottom">20</property>
<property name="row-spacing">16</property>
<child>
<object class="GtkBox" id="btns_box">
<property name="orientation">horizontal</property>
<property name="spacing">6</property>
<child>
<object class="GtkMenuButton" id="native_emojis_button">
<property name="icon-name">tuba-sentiment-satisfied-symbolic</property>
<property name="tooltip-text" translatable="yes">Emoji Picker</property>
<style>
<class name="flat" />
</style>
</object>
</child>
<child>
<object class="GtkMenuButton" id="custom_emojis_button">
<property name="icon-name">tuba-bear-symbolic</property>
<property name="tooltip-text" translatable="yes">Custom Emoji Picker</property>
<style>
<class name="flat" />
</style>
</object>
</child>
<child>
<object class="GtkButton" id="add_media_button">
<property name="icon-name">tuba-image-round-symbolic</property>
<style>
<class name="flat" />
</style>
</object>
</child>
<child>
<object class="GtkToggleButton">
<property name="icon-name">format-justify-left-symbolic</property>
<style>
<class name="flat" />
</style>
</object>
</child>
<child>
<object class="GtkToggleButton">
<property name="icon-name">tuba-warning-symbolic</property>
<style>
<class name="flat" />
</style>
</object>
</child>
<layout>
<property name="column">0</property>
<property name="row">0</property>
<property name="column-span">2</property>
</layout>
</object>
</child>
<child>
<object class="GtkBox" id="dropdowns_box">
<property name="orientation">horizontal</property>
<property name="spacing">12</property>
<layout>
<property name="column">0</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkLabel" id="counter_label">
<property name="halign">end</property>
<property name="valign">center</property>
<property name="ellipsize">end</property>
<property name="margin-start">12</property>
<style>
<class name="font-bold" />
<class name="accented-color" />
</style>
<layout>
<property name="column">1</property>
<property name="row">1</property>
</layout>
</object>
</child>
<child>
<object class="GtkButton" id="post_btn">
<property name="label" translatable="yes">Post</property>
<property name="hexpand">1</property>
<property name="halign">end</property>
<property name="valign">center</property>
<style>
<class name="pill" />
<class name="suggested-action" />
</style>
<layout>
<property name="column">2</property>
<property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
</child>
</object>
</child>
</object>
</child>
</template>
</interface>
2 changes: 1 addition & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ namespace Tuba {
void compose_activated () {
if (accounts.active.instance_info == null) return;

new Dialogs.Compose ();
new Dialogs.NewCompose ();
}

void back_activated () {
Expand Down
Loading
Loading