Closed ghost closed 10 years ago
Whoops... should have been == instead of != on line 532. I didn't notice because I always use both panels. I just uploaded the change and it should be fixed now.
As for the hovering bug, I've noticed it too, but I haven't been able to figure out what is causing it yet. I thought maybe it had something to do with my graphics card, as I've had similar issues before, but if you're getting it too, than maybe it's something else...
Yes, appear to be another thing... and also this problem it's difficult to solved, because Cinnamon not report errors or warrnings, and the problem only occurs on some time...
Another solution can be have the desklet implementation, in some subfolder of your applet and you can copy the desklet subfolder to the Cinnamon official desklets folder, and then you can load the desklet like i do currently with my sticky notes. The only thing that can be problematic it's that i don't know if i need to restart cinnamon to take effect or i can do some things to update all without need the cinnamon restart.
Speaking of other things... You can notice that cinnamon not reload correctly the user style sheet, when you change the cinnamon theme? This only occurs with desklets and not with applets, and you can see the problem only if you have your own stylesheet.css. This also affected your soundbox, desklet.
You know what happend with the Cinnamon pull request? You have several update at last tow pull request that i need to know if they are merge o not, and also I have a pull request, that it's to much importan for me. because solve the problem of encode in settings, and this allow complete support on the settings to write in all language.
I fixed the visual 'stutter'. The problem was actually quite simple. At some point I had set the size of the top box to 200X200, and so the notes were being drawn outside the container they were in.
As for the stylesheet bug you mentioned, I noticed it on the latest stable, but I haven't noticed it in a while, so I think the issue may be fixed since then (I've been using a more recent version from the nightlies).
I'm hoping the pull requests get merged soon, too, but I have no idea when or if that will happen.
Hey I´m interested to know how this is gonna look like!So clicking the icon will open up a popup with notes?
@collinss thanks for the information.
@zagortenay333 it's better than do you said.. It's more or less like rewrite all desklet behavior to be controlled by a applet... Really an interesting idea of @collinss...
@collinss when you advance more in this if you like tell me to test. See also if you want the cinnamon code of magnifier https://github.com/linuxmint/Cinnamon/blob/2d1ac4d4a68348d0a58b3aa76a877e24de6473cd/js/ui/magnifier.js
Magnifier added directly a new scope to the global.state
If this have a happy end... will be good a new category of cinnamon called application that can be added to the panel also floating like a desklet and normal app. The only thing that it's missing it's add the app to the application list, and i think that it's not a problem....
@collinss see:
//determine boundaries
let monitor = Main.layoutManager.primaryMonitor;
let startX = PADDING + monitor.x;
let startY = PADDING + monitor.y;
if ( Main.desktop_layout != Main.LAYOUT_TRADITIONAL ) startY += Main.panel.actor.height;
let width = monitor.width - PADDING;
let height = monitor.height - Main.panel.actor.height - PADDING;
if ( Main.desktop_layout == Main.LAYOUT_CLASSIC ) height -= Main.panel2.actor.height;
Main.panel2.actor.height; throw exception because Main.panel2 = null
An also the panel can be retractable: Appear that the correct way to retrive the screen height it use this :
_processPanelSize: function(bottomPosition) {
let panelHeight;
let panelResizable = global.settings.get_boolean("panel-resizable");
if(panelResizable) {
if(bottomPosition) {
panelHeight = global.settings.get_int("panel-bottom-height");
}
else {
panelHeight = global.settings.get_int("panel-top-height");
}
}
else {
let themeNode = this.actor.get_theme_node();
panelHeight = themeNode.get_length("height");
if(!panelHeight || panelHeight == 0) {
panelHeight = 25;
}
}
if((!Main.panel2)&&(((this.orientation == St.Side.TOP)&&(bottomPosition))||
((this.orientation == St.Side.BOTTOM)&&(!bottomPosition)))) {
panelHeight = 0;
}
return panelHeight;
},
@zagortenay333 Eventually what I want is to have several icons in the panel that will perform all of the necessary actions, though I will probably keep the menu as an option. The reason I did the menu first is that it was easier, and I don't yet have the icons. (I'm not much of an artist, so if you want to do the icons, I certainly wouldn't complain...)
@lestcape Thanks for the info. I'll look into it when I have a chance. Since I do most of my work on my laptop, I haven't tested it with a second monitor yet, so I was expecting I might need to change some things there.
Sounds very Interesting!
I don´t claim to be the most talented when it comes to making icons either, but I could give it a try.Only thing that I might complain in advance, if you allow, is symbolic icons. Is it gonna use them or colored icons?
I seem to be allergic to anything non-symbolic in the panel XD
@zagortenay333 I converted all icons of my sticky note in svg, but i don't know yet how I can load as symbolic icons. You know if the gnome menu can display the icons as symbolic or only normal icons?? The visual difference it's that you can set a color on theme....
@collinss this works:
_processPanelSize: function(bottomPosition) {
let panelHeight;
if(bottomPosition) {
if(!Main.panel2) {
if(this.orientation == St.Side.BOTTOM)
panelHeight = Main.panel.actor.height;
else
panelHeight = 0;
} else {
panelHeight = Main.panel2.actor.height;
}
} else {
if(!Main.panel2) {
if(this.orientation == St.Side.BOTTOM)
panelHeight = 0;
else
panelHeight = Main.panel.actor.height;
} else {
panelHeight = Main.panel.actor.height;
}
}
return panelHeight;
The GnoMenu does use symbolic icons.However, I believe that it merely borrows those from the system icon theme (gnome icons).If you need to make your own icons, then that obviously wouldn´t work. I don´t know exactly how to make symbolic icons. From what I understand, you convert the svg icon into text or something like that.So with some settings in Inkspace.You can probably find a tutorial somewhere.
@collinss see this: https://github.com/linuxmint/Cinnamon/blob/55880421b91ed51a2be255cc555ee605e0ee63d0/js/ui/boxpointer.js
and find the function: _reposition: function(sourceActor, alignment);
and internally see this declaration: let themeNode = this.actor.get_theme_node();
See that appears twice, and I can not say nothing more on cinnamon like this. The last time when i said on cinnamon web site about some missing semicolons. I finally had to know how many hours spend mwebstern works on Cinnamon.
Thank @zagortenay333, it's only fill with pure gray the area that you want to have color... My problem it's load the icon as symbolic on cinnamon, not how i can construct the icons... This is why i ask for gnomenu, to find the correct code...
GnoMenu has the ".gnomenu-panel-button" and ".gnomenu-panel-menu-button" selectors.So you could change the color of it´s symbolic icon to green(for example) while the other icons remain white.Ie. if I remember correctly! I don´t how to actually do that in terms of coding.
Yes it's more less that i need!!! thanks...
@zagortenay333 I was planning on both a symbolic and fullcolor icon set.
Symbolic icons are actually quite easy to make. The only stipulations are that you:
bebebexx
for whereever you want the colors to change (where xx is the alpha level of your choice)-symbolic.svg
You don't even have to do any text editing.
To create a sybolic icon use:
let file = Gio.file_new_for_path(iconPath);
let gicon = new Gio.FileIcon({ file: file });
let symbolicIcon = new St.Icon({ gicon: gicon, icon_size: iconSize, icon_type: St.IconType.SYMBOLIC });
EDIT: Alternatively you could add the folder where the icons are to the icon theme by:
Gtk.IconTheme.get_default().append_search_path(iconPath);
@lestcape I finally got around to looking at the code you posted. It looks like the exception you mentioned was already fixed. (I had an == rather than a !=). Try the latest version. It should work for you now. Also, I just tested with two monitors and that seems to be working fine as well.
Edit: Oh, I see what you mean about the hidden panels. I'm not sure if it's worth fixing, as the main purpose of the code is to make sure that new notes aren't covering old ones, if possible. Adding the fix would cause a whole host of other problems, such as what happens if the user decides to later change whether the panel is auto-hidden? I'll have to think about it some more, but it certainly wont be a priority, as it works just fine as it is.
@collinss
The auto hide do not change the height of panel. This changed the whole desktop... if you need to fill all area, you need to connect to signal panel hide.
The problem of symbolic icon it's that i need the icon on the background of the desklet and i don't know how make the two things at the same time...
Your edit appear to be the solutions.
@lestcape I understand how auto-hide works, however, desklets don't appear to consider auto-hide at all when doing position calculations, so to be consistent (and to make my life easier) I wont worry about it for now. I doubt it will make much difference in any case.
I just posted some updates. The panel is now more or less the way I want it (except for replacing the text with icons). I also added a focus
pseudoclass - though there are still bugs to work out with it. Feel free to try it out and let me know what you think.
There are some bugs that I already know about. You can check out the readme to see what they are, and what I still have planned before release.
Very well for me... Why you do not create a sticky@scollins folder and then put inside the files, it's better than need to make a folder always...
Some time the events are not captured, and the box are not hide and i can open the terminal over the box(the icon of terminal are behind the box)... I can not find yet when this occurs, this appear to be aleatory.
@collinss do you know how i can capture all button-release-event?
The problem it's that:
global.stage.connect('button-release-event', Lang.bind(this, this._onButtonRelease));
Only it's called when i over the desklet or over other clutter component, i also test
global.stage.connect('captured-even', Lang.bind(this, this._onButtonRelease));
and then
if(event.type()== Clutter.EventType.BUTTON_RELEASE) { ... }
but the same happend.
@lestcape The reason I don't put it in a folder is that I have a different repository for each applet and desklet. You could just navigate to your applet folder and type
git clone https://github.com/collinss/Cinnamon-Sticky-Notes.git sticky@scollins
That way you can just
git pull origin master
Whenever I make a change.
As for the stage events, if you want to be able to intercept all stage events, you will need to include
global.set_stage_input_mode(Cinnamon.StageInputMode.FULLSCREEN);
in order for it to work properly.
Mmm you have your github on the same place that normal applets and desklets folder, well I underestand, but i don't like this idea... Can be problematic if you want to test old version...
You detected why the events are not captured some times?
Thanks: global.set_stage_input_mode(Cinnamon.StageInputMode.FULLSCREEN); works...
I began to make my sticky note resizable with the mouse, the first attempt can be see on github... I need to redefine how the resize it's controlled, but well.
You can do more les the same a fixed size to the note can be problematic to some user that have the desktop full of things.
Your idea also can be use to made a Sidebar like windows vista, to control all desklet inside the bar. http://imagenes.es.sftcdn.net/es/scrn/66000/66864/windows-sidebar-styler-15.jpg
Scrolling has now been added to the notes.
@lestcape I'm not sure why I would want/need to test an older version, but if I did, I could check out an older version using git commands. Also, this greatly streamlines my workflow because I can simply make a change to the file, save, and then restart Cinnamon. Then when I'm done, I can simply commit my changes from the same directory. I never need to do any copying, etc. It's especially useful for troubleshooting.
@lestcape Also the problem you described earlier with the event capture is a known issue and was actually intentional (sort of). When I first started, I designed the notes to behave like popup menus (click anywhere and the menu intercepts the event and closes the menu). Since then I have decided to change how that is handled, and based all development decisions on that, but haven't yet gone back and changed the behavior of the notes to reflect that. The behavior you are actually experiencing, is that when in raised mode, a single click anywhere but on a note will simply lower the notes behind all windows (if any). A second will then do whatever the click was intended to do. It will be fixed before release.
@collinss good for you, if i do that, sure became on terrible disorder.
@collinss I not have any doubt, if you have raised the note and you want access to another place you need first lower the note and then the user can access, do not exist any other way because you have a clutter component intercepting all message, but well.... Also remember that i use your idea on my sticky, but a little different when raised all desklet instance raised if you select one this instance continues raised and also on center and the rest it's on lower. I really don't see any new behavior here... I only see the necessity of do the things on this way.
@collinss the real true it's that i don't know any about git command, also i was telling you, if you can added a request to change the style class of menu, because i don't know how create two pull requests at the same time on github, and i had a plan to send one pull request...
The best way to send two pull requests at once is to use branches. For example, if you wanted to make a pull request, (after you have forked the repo and pulled to your computer) type
git checkout master
git branch branch_name
git checkout branch_name
where branch_name
is the name you choose for your branch.
Then make your changes, commit them, and type
git push origin branch_name
From github select the branch from the list, and do a compare and pull. Then when you want to submit another pull request, you can repeat the process using a different branch_name
. If you do it this way you can also add commits to your pull request by pushing them to the same branch.
Thanks... I make all my pull request directly over the github... and always with several problems, I forgot to format the code the file change because i not use the nightly builds...
What you think about change the current way of raise desklet by this one...
Instead create a new scope for your applet, create a new scope for the others desklet and then re-parent the scope to be on the top... Maybe this can trick Cinnamon and use all feature without problems.
Ok, I've now fixed all of the bugs I know of. All that remains before release is to add icons and some themes, and fix any other bugs that might show up between now and then.
@lestcape let me know if you are experiencing any of the bugs you were having before.
Also note that when in raised mode, clicking outside a note will no longer lower the notes - you have to do it manually from the panel now.
Being arrogant is an offense in English? In spanish this can be a good or a bad attribute... At less on Cuba, on Mexico never it's bad. I test and tell you if i find any problem.
@collinss when you create a new note you can not drag and drop the note or write any thing. It's totally transparent, for the mouse. The rest of notes react well, except because some time the last note that had a focus, gain the focus automatically, without click on the note. I really don't like the current behavior of the blocked the desktop and only when lower the notes you can use the rest of apps.
Oh and now the notes are lower, one of them have a focus and i cannot click on some note.
Hmm... I'm not having any of those problems. New notes appear just fine for me, and the desktop is not blocked for me at all when in raised mode.
The problems you mentioned are all problems that I had at one point or another, but I've since fixed them. (Or so I thought...)
It probably has nothing to do with it, but what version of Cinnamon are you using?
I use the lasted stable release cinnamon --version Cinnamon 2.0.14
I'm using a slightly newer version, but I can't imagine that would matter too much in this case.
Try downloading the latest version of the applet again, restart Cinnamon, and see if that fixes anything.
I do this right now(I knew you were gonna say that.), if I restart cinnamon after create a new note, the problem not happened, but if i create a new note, then i have the problem.
I recomend you, do not add more options and try to resolved the problem first... To be all more clear, i want to help on this... I need to implement my idea and when it's working i tell you...
@lestcape I just push a bunch of changes, including a number of bugfixes. Let me know if you are still having any of those problems after updating. Also, I haven't been able to reproduce the 'blocked' bug you were talking about in raised mode, even after testing on 3 different machines running different versions of Cinnamon. In every case I can access all open programs, desktop, panel, and desklets while in raised mode.
Ok, thanks, i have really complicate with Configurable menu... but when I have a little time I see. Thats a good things and you tried several times it and it works! That means that finding a bug can not be easy...
Hi @collinss really i don't think that your way can be better... but on Cinnamon github i can not speak clear... And i don't want that you look bad...
If you add some padding then you need reduce the padding of the mainbox, otherwise this can look bad, and this not resolve the problem, only create more, because you never can remove this padding again and you need to make another box to the menu, not sense...
If you set the old style class and then add a new one after the declaration of the old style class, and the author of new theme use the new one then all will be ok... and the old themes can works, because they use the old and they don't know that exist a new one...
Only you need to add a new line without remove the old.
this.mainBox = new St.BoxLayout({ style_class: 'menu-applications-box', vertical:false });//not change
//Added: this.mainBox.add_style_class_name('menu-applications-main-box');
This is the way that i currently use to support the old themes and add new attributes on all my desklets and applets, and this work ok!!! the only problem can be that you declare the style of menu-applications-main-box before menu-applications-box, on this case can not be apply the theme correctly.
Also @collinss you know what happend with this?? See my file: https://github.com/lestcape/Cinnamon-Installer/blob/master/ver
Then look the raw: https://raw.githubusercontent.com/lestcape/Cinnamon-Installer/master/ver
It's not update... 0.3 it's the correct number...
See the commit(last file): https://github.com/lestcape/Cinnamon-Installer/commit/59cc1a544e20de983baaee2fd479e9546d9031c7
You know what happend with github? I use this number to check if the app have an update... soo...
mmm, appear that the raw have a time to be updated, now reported the correct number
@collinss I agree with you 100% now!! The change on the menu is necessary and need to be done, try to patch always have a repercussion and waiting it's worst... Also this new version of Cinnamon will have backports...? I think no... so then what?
@lestcape No, this version won't have backports because the next release is LTS - therefore they are discontinuing support for anything before Mint 17.
With bottom panel :
(null)@/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js:285 ([object Object],[object _private_Clutter_Event],false)@/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js:303 _emit("activate",[object _private_Clutter_Event],false)@/usr/share/cjs-1.0/signals.js:124 ([object _private_Clutter_Event],false)@/usr/share/cinnamon/js/ui/popupMenu.js:113 ([object _private_Cinnamon_GenericContainer],[object _private_Clutter_Event])@/usr/share/cinnamon/js/ui/popupMenu.js:86
With panel top:
(cinnamon:2574): Clutter-CRITICAL **: clutter_text_set_text: assertion 'CLUTTER_IS_TEXT (self)' failed JS ERROR: !!! Exception in callback for signal: activate JS ERROR: !!! message = '"Main.panel2 is null"' JS ERROR: !!! fileName = '"/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js"' JS ERROR: !!! lineNumber = '532' JS ERROR: !!! stack = '"()@/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js:532 (null)@/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js:285 ([object Object],[object _private_Clutter_Event],false)@/home/lestcape/.local/share/cinnamon/applets/sticky@scollins/applet.js:303 _emit("activate",[object _private_Clutter_Event],false)@/usr/share/cjs-1.0/signals.js:124 ([object _private_Clutter_Event],false)@/usr/share/cinnamon/js/ui/popupMenu.js:113 ([object _private_Cinnamon_GenericContainer],[object _private_Clutter_Event])@/usr/share/cinnamon/js/ui/popupMenu.js:86
The applet can launch the notes if you have the two panels without any error, but if you are over the note some times the note disappear, sometime not.