ags: sync

This commit is contained in:
end-4
2024-01-22 23:08:47 +07:00
parent 502abe7648
commit 63d471c3df
5 changed files with 95 additions and 43 deletions
-1
View File
@@ -1 +0,0 @@
<svg viewBox="0 0 320 320" xmlns="http://www.w3.org/2000/svg"><path d="m297.06 130.97c7.26-21.79 4.76-45.66-6.85-65.48-17.46-30.4-52.56-46.04-86.84-38.68-15.25-17.18-37.16-26.95-60.13-26.81-35.04-.08-66.13 22.48-76.91 55.82-22.51 4.61-41.94 18.7-53.31 38.67-17.59 30.32-13.58 68.54 9.92 94.54-7.26 21.79-4.76 45.66 6.85 65.48 17.46 30.4 52.56 46.04 86.84 38.68 15.24 17.18 37.16 26.95 60.13 26.8 35.06.09 66.16-22.49 76.94-55.86 22.51-4.61 41.94-18.7 53.31-38.67 17.57-30.32 13.55-68.51-9.94-94.51zm-120.28 168.11c-14.03.02-27.62-4.89-38.39-13.88.49-.26 1.34-.73 1.89-1.07l63.72-36.8c3.26-1.85 5.26-5.32 5.24-9.07v-89.83l26.93 15.55c.29.14.48.42.52.74v74.39c-.04 33.08-26.83 59.9-59.91 59.97zm-128.84-55.03c-7.03-12.14-9.56-26.37-7.15-40.18.47.28 1.3.79 1.89 1.13l63.72 36.8c3.23 1.89 7.23 1.89 10.47 0l77.79-44.92v31.1c.02.32-.13.63-.38.83l-64.41 37.19c-28.69 16.52-65.33 6.7-81.92-21.95zm-16.77-139.09c7-12.16 18.05-21.46 31.21-26.29 0 .55-.03 1.52-.03 2.2v73.61c-.02 3.74 1.98 7.21 5.23 9.06l77.79 44.91-26.93 15.55c-.27.18-.61.21-.91.08l-64.42-37.22c-28.63-16.58-38.45-53.21-21.95-81.89zm221.26 51.49-77.79-44.92 26.93-15.54c.27-.18.61-.21.91-.08l64.42 37.19c28.68 16.57 38.51 53.26 21.94 81.94-7.01 12.14-18.05 21.44-31.2 26.28v-75.81c.03-3.74-1.96-7.2-5.2-9.06zm26.8-40.34c-.47-.29-1.3-.79-1.89-1.13l-63.72-36.8c-3.23-1.89-7.23-1.89-10.47 0l-77.79 44.92v-31.1c-.02-.32.13-.63.38-.83l64.41-37.16c28.69-16.55 65.37-6.7 81.91 22 6.99 12.12 9.52 26.31 7.15 40.1zm-168.51 55.43-26.94-15.55c-.29-.14-.48-.42-.52-.74v-74.39c.02-33.12 26.89-59.96 60.01-59.94 14.01 0 27.57 4.92 38.34 13.88-.49.26-1.33.73-1.89 1.07l-63.72 36.8c-3.26 1.85-5.26 5.31-5.24 9.06l-.04 89.79zm14.63-31.54 34.65-20.01 34.65 20v40.01l-34.65 20-34.65-20z"/></svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

+34 -28
View File
@@ -166,27 +166,27 @@ $onChatgpt: $onPrimary;
padding: 0rem $rounding_medium;
}
.sidebar-navrail-btn > box > label {
.sidebar-navrail-btn>box>label {
@include full-rounding;
@include menu_decel;
}
.sidebar-navrail-btn:hover > box > label:first-child,
.sidebar-navrail-btn:focus > box > label:first-child {
.sidebar-navrail-btn:hover>box>label:first-child,
.sidebar-navrail-btn:focus>box>label:first-child {
background-color: $hovercolor;
}
.sidebar-navrail-btn:active > box > label:first-child {
.sidebar-navrail-btn:active>box>label:first-child {
background-color: $activecolor;
}
.sidebar-navrail-btn-active > box > label:first-child {
.sidebar-navrail-btn-active>box>label:first-child {
background-color: $secondaryContainer;
color: $onSecondaryContainer;
}
.sidebar-navrail-btn-active:hover > box > label:first-child,
.sidebar-navrail-btn-active:focus > box > label:first-child {
.sidebar-navrail-btn-active:hover>box>label:first-child,
.sidebar-navrail-btn-active:focus>box>label:first-child {
background-color: mix($secondaryContainer, $hovercolor, 90%);
color: mix($onSecondaryContainer, $hovercolor, 90%);
}
@@ -346,7 +346,7 @@ $onChatgpt: $onPrimary;
background-color: $activecolor;
}
.sidebar-selector-tab-active > box > label {
.sidebar-selector-tab-active>box>label {
color: $primary;
}
@@ -531,19 +531,15 @@ $onChatgpt: $onPrimary;
.sidebar-chat-send:hover,
.sidebar-chat-send:focus {
background-color: mix(
$sidebar_chat_textboxareaColor,
$t_onSecondaryContainer,
97%
);
background-color: mix($sidebar_chat_textboxareaColor,
$t_onSecondaryContainer,
97%);
}
.sidebar-chat-send:active {
background-color: mix(
$sidebar_chat_textboxareaColor,
$t_onSecondaryContainer,
80%
);
background-color: mix($sidebar_chat_textboxareaColor,
$t_onSecondaryContainer,
80%);
}
.sidebar-chat-send-available {
@@ -670,9 +666,10 @@ $onChatgpt: $onPrimary;
@include menu_decel;
min-height: 4.773rem;
min-width: 4.773rem;
font-size: 4rem;
background-color: white;
color: black;
@include icon-material;
font-size: 2.727rem;
background-color: $onBackground;
color: $background;
}
.sidebar-chat-chip {
@@ -706,10 +703,12 @@ $onChatgpt: $onPrimary;
background-color: $t_surfaceVariant;
color: $onSurfaceVariant;
}
.sidebar-chat-chip-toggle:focus,
.sidebar-chat-chip-toggle:hover {
background-color: $hovercolor;
}
.sidebar-chat-chip-toggle:active {
background-color: $activecolor;
}
@@ -733,6 +732,7 @@ $onChatgpt: $onPrimary;
.sidebar-pin-enabled {
background-color: $primary;
label {
color: $onPrimary;
}
@@ -753,13 +753,16 @@ $onChatgpt: $onPrimary;
margin-left: -0.136rem;
padding-left: 0.818rem;
}
.sidebar-waifu-content {
margin-left: 0.682rem;
}
.sidebar-waifu-txt {
@include readingfont;
margin-left: 0.682rem;
}
.sidebar-waifu-image {
margin-left: 0.682rem;
@include normal-rounding;
@@ -767,26 +770,29 @@ $onChatgpt: $onPrimary;
background-repeat: no-repeat;
background-position: center;
}
.sidebar-waifu-image-actions {
padding: 0.313rem;
}
$waifu_image_overlay_transparency: 0.7;
.sidebar-waifu-image-action {
@include full-rounding;
min-width: 1.875rem;
min-height: 1.875rem;
background-color: rgba(
0,
0,
0,
$waifu_image_overlay_transparency
); // Fixed cuz on image
background-color: rgba(0,
0,
0,
$waifu_image_overlay_transparency ); // Fixed cuz on image
color: rgba(255, 255, 255, $waifu_image_overlay_transparency);
}
.sidebar-waifu-image-action:hover,
.sidebar-waifu-image-action:focus {
background-color: rgba(30, 30, 30, $waifu_image_overlay_transparency);
}
.sidebar-waifu-image-action:active {
background-color: rgba(60, 60, 60, $waifu_image_overlay_transparency);
}
}
+4 -10
View File
@@ -23,16 +23,10 @@ export const chatGPTTabIcon = Box({
});
const ChatGPTInfo = () => {
const openAiLogo = Icon({
const openAiLogo = Label({
hpack: 'center',
className: 'sidebar-chat-welcome-logo',
icon: `${App.configDir}/assets/openai-logomark.svg`,
setup: (self) => Utils.timeout(400, () => { // A long wait, but no one's going to open sidebar right on init anyway
const styleContext = self.get_style_context();
const width = styleContext.get_property('min-width', Gtk.StateFlags.NORMAL);
const height = styleContext.get_property('min-height', Gtk.StateFlags.NORMAL);
self.size = Math.max(width, height, 1) * 116 / 180; // Why such a specific proportion? See https://openai.com/brand#logos
})
label: 'forum',
})
return Box({
vertical: true,
@@ -43,7 +37,7 @@ const ChatGPTInfo = () => {
className: 'txt txt-title-small sidebar-chat-welcome-txt',
wrap: true,
justify: Gtk.Justification.CENTER,
label: 'ChatGPT',
label: 'Assistant',
}),
Box({
className: 'spacing-h-5',
@@ -153,7 +147,7 @@ export const OpenaiApiKeyInstructions = () => Box({
})]
});
export const chatGPTWelcome = Box({
const chatGPTWelcome = Box({
vexpand: true,
homogeneous: true,
child: Box({
+55 -2
View File
@@ -5,7 +5,7 @@ const { Box, Button, Label, Overlay, Revealer, Scrollable, Stack } = Widget;
const { execAsync, exec } = Utils;
import { MaterialIcon } from "../../../lib/materialicon.js";
import { MarginRevealer } from '../../../lib/advancedwidgets.js';
import { setupCursorHover } from "../../../lib/cursorhover.js";
import { setupCursorHover, setupCursorHoverInfo } from "../../../lib/cursorhover.js";
import WaifuService from '../../../services/waifus.js';
async function getImageViewerApp(preferredApp) {
@@ -220,10 +220,62 @@ const WaifuImage = (taglist) => {
return thisBlock;
}
const WaifuInfo = () => {
const waifuLogo = Label({
hpack: 'center',
className: 'sidebar-chat-welcome-logo',
label: 'photo_library',
})
return Box({
vertical: true,
vexpand: true,
className: 'spacing-v-15',
children: [
waifuLogo,
Label({
className: 'txt txt-title-small sidebar-chat-welcome-txt',
wrap: true,
justify: Gtk.Justification.CENTER,
label: 'Waifus',
}),
Box({
className: 'spacing-h-5',
hpack: 'center',
children: [
Label({
className: 'txt-smallie txt-subtext',
wrap: true,
justify: Gtk.Justification.CENTER,
label: 'Powered by waifu.im',
}),
Button({
className: 'txt-subtext txt-norm icon-material',
label: 'info',
tooltipText: 'A free Waifu API. An alternative to waifu.pics.',
setup: setupCursorHoverInfo,
}),
]
}),
]
});
}
const waifuWelcome = Box({
vexpand: true,
homogeneous: true,
child: Box({
className: 'spacing-v-15',
vpack: 'center',
vertical: true,
children: [
WaifuInfo(),
]
})
});
const waifuContent = Box({
className: 'spacing-v-15',
vertical: true,
vexpand: true,
attribute: {
'map': new Map(),
},
@@ -251,6 +303,7 @@ export const waifuView = Scrollable({
child: Box({
vertical: true,
children: [
waifuWelcome,
waifuContent,
]
}),
+2 -2
View File
@@ -11,12 +11,12 @@ import { waifuView, waifuCommands, sendMessage as waifuSendMessage, waifuTabIcon
const APIS = [
{
name: 'ChatGPT',
name: 'Assistant',
sendCommand: chatGPTSendMessage,
contentWidget: chatGPTView,
commandBar: chatGPTCommands,
tabIcon: chatGPTTabIcon,
placeholderText: 'Message ChatGPT',
placeholderText: 'Message assistant',
},
{
name: 'Waifus',