maoschanz / emoji-selector-for-gnome

This extension provide a popup menu with some emojis ; clicking on an emoji copies it to the clipboard.
GNU General Public License v3.0
470 stars 76 forks source link

Add GNOME 40 support in the extensions prefs window #149

Closed frandieguez closed 2 years ago

frandieguez commented 3 years ago

Hi,

please consider merging this PR to add support to GNOME 40 in the preferences page of this extension.

There are some parts that are visually more appealing but there are some rough parts that I'm not particularly happy about.

image

Regards, Fran

frandieguez commented 3 years ago

In addition I've added

maoschanz commented 3 years ago

that's not gnome 3.40 support, that's an entire redesign... I'm ok with gnome 3.40 support, not with a redesign:

this is a matter of usability, not appeal.

If they removed the possibility to have a stack switcher in the headerbar, then the corresponding code should be deleted, not commented, and the "about" should be somehow moved to a classic GtkAboutDialog

(also please don't reindent files, especially if it's to replace normal tabs with bunch of spaces)

Concerning the makefile, thanks i really appreciate the idea, but i'm not sure it's correct: where is $INSTALL_DIR defined?

frandieguez commented 3 years ago

First of all, thanks for your quick comments and for your extension.

If you find that the changes proposed will not be landed, no problem my own needs are fulfilled so I will wait for your official release. Notice that I'm not a GTK developer, and this is the first time that I touch anything related with it. For me is a huge effort to make a simple change cause I have to see other examples, read documentation, etc., and I'm not particularly fond on propose changes that could not be landed.

frandieguez commented 3 years ago

I forgot answering about the makefile. This is a quick version so I will update it to support the INSTALL_DIR variable

frandieguez commented 3 years ago

Another thing. Not sure if HIG is obsolete but every major GNOME application is migrating this UX to this kind of frames libhandy-like

https://gitlab.gnome.org/Teams/Design/os-mockups/-/blob/master/app-preferences/app-preferences.png

frandieguez commented 3 years ago

Makefile improved with support for standard PREFIX variable, so now in order to install system-wide: PREFIX=/usr/share/gnome-shell/extensions/ make install

frandieguez commented 3 years ago

Ok, I've got the prefs panel converted back to GtkStack, but I have some problems that maybe you can help me with.

I replace de GtkStackSwitcher inside the headerbar but that makes window buttons disappear. I'm just taking ideas from other extensions but not sure if I'm doing well.

Peek 12-03-2021 17-38

frandieguez commented 3 years ago

I have changed the GtkStack with a GtkNotebook with gives the prefs panel tabs, so no more scrolls

No plans to do more changes, as I'm not sure if it they will land.

Hope you find these changes useful. And please, don't judge me too much for them, as I'm a newbie in Gtk

AlexWayfer commented 3 years ago

(you can now add "resolves #151" to the PR description to auto-close a new issue)

azisnaufal commented 3 years ago

is there any update? will this PR get merged?

wbolster commented 3 years ago

i would :heart_eyes: to see this merged and released as well. @maoschanz please help the poor souls on gnome 40 out :pray: :upside_down_face:

in the mean time, people can restore basic functionality by editing the metadata file at$HOME/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/metadata.json and adding "40" to the shell-version list, so that it looks like this:

...
    "3.36",
    "3.38",
    "40"
  ],
...
AlexWayfer commented 3 years ago

@maoschanz, sorry for bothering you, but we're waiting for this!

edevars commented 3 years ago

Please merge this pull request. I downloaded it and works fine. :)

avanisubbiah commented 3 years ago

I can't modify the keyboard shortcut with the new settings menu. Clicking on it doesn't allow for the text to be edited at all.

EgidioCaprino commented 3 years ago

That should be fixed once this PR gets merged. In the meantime you can do this.

avanisubbiah commented 3 years ago

Ah, besides that it's great. I was able to work around it by typing out the new keyboard shortcut elsewhere and copying and pasting it into the text box.

ghost commented 3 years ago

Delete emoji-selector@maestroschan.fr from ~/.local/share/gnome-shell/extensions Download source from frandieguez/emoji-selector-for-gnome, extract, then install with ./install.sh

AlexWayfer commented 3 years ago

@maoschanz sorry, but can we get your attention here? ❤️

(oh, I just saw that I wrote the same almost a month ago)

Maybe we can setup donates/sponsorship for this repo? 😬 To support maintainers.

Queatz commented 3 years ago

gahhh I miss having this extension so much

AlexWayfer commented 2 years ago

@frandieguez there are conflicting files by the way.

daPhipz commented 2 years ago

In #156, he wrote:

the fork compatible with GNOME 40 already exists, there is a pull request opened with it. But it's not compatible with any older GNOME Shell version including the one i use, so i can't merge it yet

frandieguez commented 2 years ago

I'll tr to update my PR. Hope it finally lands

EgidioCaprino commented 2 years ago

@frandieguez could you please resolve the conflicts?

jacksongoode commented 2 years ago

@frandieguez We need you 🥺

the-loudspeaker commented 2 years ago

I see no conflicts on the branch. yayy!! Hopefully it lands now @maoschanz ?

the-loudspeaker commented 2 years ago

^ @frandieguez Just a gentle reminder. :)

frandieguez commented 2 years ago

I don't know if after a gnome cycle this pr will get merged. I'm willing, hope, and pray that this will finally gets merged but have no news from the mantainer.

I use this extension on a daily basis, and for now it is working perfectly.

the-loudspeaker commented 2 years ago

yay! finally without any conflicts. Hopefully it gets merged now. :) cc: @shilangyu

melWiss commented 2 years ago

merge please!!

frandieguez commented 2 years ago

@maoschanz is anything that I could do to get this merged and release? please this extension is really useful

raphink commented 2 years ago

This patch currently does not work with Ubuntu 21.10 (Gnome 40.5):

stephane-klein commented 2 years ago

I don't know if it is a bug related to this pull request, but I can't type key in keybinding_entry GtkEntry widget:

I can't update <super>e value.


Same that: https://github.com/maoschanz/emoji-selector-for-gnome/pull/149#issuecomment-840329429

stephane-klein commented 2 years ago

I don't know if it is a bug related to this pull request, any top icon change icon list display.

image

And when I click on the imoji, nothing happens, no copy, picker isn't closed…

chmouel commented 2 years ago

Maybe it's me but I tried this PR and I could not get this to work without having to resort to this (i guess ugly) patch, my knowledge of extensions and javascript is pretty non existent so that may be completely wrong, but testing your PR with that patch on gnome4.1/arch and it works well enough for me to search and copy emojis correctly ☺️

diff --git a/emoji-selector@maestroschan.fr/emojiButton.js b/emoji-selector@maestroschan.fr/emojiButton.js
index fdc615b..d26928b 100644
--- a/emoji-selector@maestroschan.fr/emojiButton.js
+++ b/emoji-selector@maestroschan.fr/emojiButton.js
@@ -185,7 +185,7 @@ var EmojiButton = class EmojiButton {
                if (genrable) {
                        temp += GENDERS[Extension.SETTINGS.get_int('gender')];
                }
-               Extension.GLOBAL_BUTTON.searchItem.shiftFor(temp);
+        //Extension.GLOBAL_BUTTON.searchItem.shiftFor(temp);
                return temp;
        }
 };
diff --git a/emoji-selector@maestroschan.fr/emojiCategory.js b/emoji-selector@maestroschan.fr/emojiCategory.js
index c4ee305..908b3c2 100644
--- a/emoji-selector@maestroschan.fr/emojiCategory.js
+++ b/emoji-selector@maestroschan.fr/emojiCategory.js
@@ -176,7 +176,8 @@ var EmojiCategory = class EmojiCategory {
         */
        build() {
                if (this._built) { return; }
-               let ln, container;
+               let ln;
+        let container = new St.BoxLayout();
                for (let i = 0; i < this.emojiButtons.length; i++) {
                        // lines of emojis
                        if (i % this._nbColumns === 0) {

edit: the errors i had :


JS ERROR: TypeError: container is undefined
build@/home/chmouel/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/emojiCategory.js:194:4
_openCategory@/home/chmouel/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/emojiCategory.js:221:25
_toggle@/home/chmouel/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/emojiCategory.js:213:9
JS ERROR: TypeError: Extension.GLOBAL_BUTTON.searchItem.shiftFor is not a function
getTaggedEmoji@/home/chmouel/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/emojiButton.js:188:38
onButtonPress@/home/chmouel/.local/share/gnome-shell/extensions/emoji-selector@maestroschan.fr/emojiButton.js:109:26
maoschanz commented 2 years ago

sorry for not giving any updates, i wasn't motivated at the idea of merging something that would break the extension for basically everybody using an LTS, including me so i couldn't test it at all

my vacations just started so i took a little time to install gnome 41 on another machine to test things, and your version is cool it works well, thank you very much

concerning compatibility there is a solution i just tried (with another of my extensions) and it worked:

(no need to test the gtk3 version i'll test it myself after the merge)

edit: sorry i first wrote it wrong, we can't put dashes in the name of the files we import, only underscores (and no ".js" at the end)

albertvaka commented 2 years ago

Friendly ping :) If this got merged it would make at least 48 people happy, looking at the upvotes :)

balazsorban44 commented 2 years ago

Let's patiently assume the maintainer is unavailable/busy. In the meantime, here is a workaround:

  1. git clone git@github.com:maoschanz/emoji-selector-for-gnome.git
  2. cd emoji-selector-for-gnome
  3. gh pr checkout 149
  4. ./install.sh
  5. logout/login
  6. Enjoy! :tada:

Update

I cannot seem to click on individual emoji groups though. Search still works, but I cannot copy by hitting Enter or clicking on an emoji either. :grimacing: @frandieguez do you have an idea?

3-w-c commented 2 years ago

Bless you @balazsorban44 for the handy howto and the excellent vibes :pray:

For anyone else who doesn't have the gh command line tool:

git clone https://github.com/maoschanz/emoji-selector-for-gnome
cd emoji-selector-for-gnome
git remote add frandieguez https://github.com/frandieguez/emoji-selector-for-gnome
git checkout -b pr-149 frandieguez/master
./install.sh

(also, here on gnome-shell-41.2-1, clicking on groups works OK!)

illwieckz commented 2 years ago

Or even (github specific, though):

git clone https://github.com/maoschanz/emoji-selector-for-gnome.git
cd emoji-selector-for-gnome
git fetch origin pull/149/head:pr-149
git checkout pr-149
./install.sh

Or even (not github specific):

git clone https://github.com/maoschanz/emoji-selector-for-gnome.git
cd emoji-selector-for-gnome
git fetch https://github.com/frandieguez/emoji-selector-for-gnome.git master:pr-149
git checkout pr-149
./install.sh

Both avoids to add an extra remote. 😃️

And one may want to directly clone https://github.com/frandieguez/emoji-selector-for-gnome.git 😁️

But on my end the emojis and tabs are not selectable. 🤷‍♀️️

So my workaround is to always have a gedit window open and use “right click → insert emoji” feature and then I copy-paste. 👀️

3-w-c commented 2 years ago

Thanks, even better @illwieckz :clap: I think cloning this repo rather than the fork is probably a better call for most, but yes avoiding the extra remote is great.

I've now seen the "not able to select emojis" problem – it's broken on Xorg, but working on Wayland.

BTW I think there's a keyboard shortcut for the GTK emoji picker you're talking about in Gedit - Ctrl+Shift+; (semicolon), also works for me in Evolution, and probably other GTK apps.

lyrixx commented 2 years ago

But on my end the emojis and tabs are not selectable. woman_shrugging️

&

I've now seen the "not able to select emojis" problem – it's broken on Xorg, but working on Wayland.

I'm using wayland and I have the same issue (not selectable). I'm using the fork OC :)

Syzygianinfern0 commented 2 years ago

Does this work on Gnome 42?

yavko commented 2 years ago

Does this work on Gnome 42?

Not for me

dlecan commented 2 years ago

You need to add 42 to the list of compatible Gnome versions in the file emoji-selector@maestroschan.fr/metadata.json to make it work on Gnome 42

yavko commented 2 years ago

You need to add 42 to the list of compatible Gnome versions in the file emoji-selector@maestroschan.fr/metadata.json to make it work on Gnome 42

No the menu just doesn't work

yavko commented 2 years ago

Oh wow it got merged! 🎉

fgrosse commented 2 years ago

I added 42 to the metadata.json and managed to install and start the extension successfully but unfortunately it does not show any emojis (also no errors). Does anybody have a quick solution or should I open a new issue for this?

image

Thanks in advance :pray:

dispew commented 2 years ago

I really like this extension and I was a bit frustrated that it wasn't working on Gnome 40+. Tried the latest commit 3fe617c on Pop-OS 21.10 @ Gnome 40.4.0, it was unsuccessful. I forked and made some changes 929b2eb (also CSS, sorry, was strange on Pop-OS dark theme), works good enough to me. I do believe it need some more changes and code clean-up, so I will not submit a PR.

I hope it helps somehow and sorry for any mistakes. English is not my native language.

image

raphink commented 2 years ago

FTR while this extension was broken, I discovered the native way to insert emojis using Ctrl+; and Ctrl+.

Type Ctrl+; then either space (for the whole list) or the name of an emoji followed by space (for a restricted list).

lhindir commented 2 years ago

native way to insert emojis using Ctrl+; and Ctrl+.

Whoa, thanks. I might be able to drop this extension now. Unfortunately, it appears to be GTK-specific, so it won’t work in Qt or Electron apps, and it doesn’t appear to be enabled in Firefox[^1], either.

[^1]: 1232371 - [UX] Emoji picker for all platforms