diff --git a/.config/ags/assets/openai-logomark.svg b/.config/ags/assets/openai-logomark.svg deleted file mode 100644 index e04db75a5..000000000 --- a/.config/ags/assets/openai-logomark.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/.config/ags/scss/_sidebars.scss b/.config/ags/scss/_sidebars.scss index 24c50ade3..6a5288cfb 100644 --- a/.config/ags/scss/_sidebars.scss +++ b/.config/ags/scss/_sidebars.scss @@ -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); -} +} \ No newline at end of file diff --git a/.config/ags/widgets/sideleft/apis/chatgpt.js b/.config/ags/widgets/sideleft/apis/chatgpt.js index 1296c5c92..42a925b0c 100644 --- a/.config/ags/widgets/sideleft/apis/chatgpt.js +++ b/.config/ags/widgets/sideleft/apis/chatgpt.js @@ -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({ diff --git a/.config/ags/widgets/sideleft/apis/waifu.js b/.config/ags/widgets/sideleft/apis/waifu.js index c77054dd6..349e2e918 100644 --- a/.config/ags/widgets/sideleft/apis/waifu.js +++ b/.config/ags/widgets/sideleft/apis/waifu.js @@ -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, ] }), diff --git a/.config/ags/widgets/sideleft/apiwidgets.js b/.config/ags/widgets/sideleft/apiwidgets.js index 475bd496f..a015f00fe 100644 --- a/.config/ags/widgets/sideleft/apiwidgets.js +++ b/.config/ags/widgets/sideleft/apiwidgets.js @@ -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',