maoschanz / More-columns-in-applications-view

Set the number of columns in the "applications" view.
GNU General Public License v3.0
8 stars 3 forks source link

Set a minimum number of columns for appfolders #5

Open sfatula opened 4 years ago

sfatula commented 4 years ago

So, when you click on show applications, and then a folder of applications, you can see more applications. In ubuntu Gnome 20.04.1, they've really killed those application subfolders. They only show 4 across and 3 down. I'd rather they be smaller and it show more instead of scrolling.

This modification to the existing function seems to work, but disables the original function of your extension, so, somehow, I am sure it's possible to do both. Would you consider modifying the extension to allow it to do so?

function setNbColumns(setting) {

    if (!injections['_init']) {
        injections['_init'] = injectToFunction(AppDisplay.BaseAppView.prototype, '_init', function(){
            this._grid._minColumns = setting;
        });
    }

    let appdisplayView = Main.overview.viewSelector.appDisplay._views;
    for (let i = 0; i < appdisplayView.length; i++) {
        appdisplayView[i].view._grid._minColumns = setting;
    }

    let folderIconsList = Main.overview.viewSelector.appDisplay._views[1].view.folderIcons;
    if (folderIconsList) {
        // Old GS versions only
        folderIconsList.forEach(function(i){
            i.view._grid._minColumns = setting;
        });
    }

}
maoschanz commented 4 years ago

what's your modification here?

sfatula commented 4 years ago

In ubuntu 20.04, you can put applications into folders on the show applications screen. So, you do this on the show applications screen by dragging an app over another app and it makes a folder, no mod needed for that, built in function. I've attached a photo of mine. When you click on one of those folders, gnome shows 3 horizontal rows of 4 huge icons only, if you have more than 12 apps in a folder, you have to scroll. On ubuntu 18.04 using an extension, it showed almost the whole screen. This mod changes your program to instead of expanding the show applications view, to expanding the folder within that view by shrinking the icons so more fit.

I've attached a picture of one application folder. Really, likely better to expand the window if that's possible as the icons are pretty small, but, good enough as is for me.

Is that what you were asking? With gnome now supporting these application menus as they do, your extension as is only solved the top level view, not the subfolder view.

IMG_0211 IMG_0212

maoschanz commented 4 years ago

I understood your text and i know very well what an appfolder is: GNOME Shell has been supporting them for years, and there is literally a comment in my code to say this extension handles them with older GNOME Shell versions.

But I haven't touched that code for months and the piece of uncolored javascript i see here looks like the current one to me, so I'm asking you what you changed. People usually suggest modifications through pull requests or ".patch" files where the differences are clearly highlighted

maoschanz commented 4 years ago

nevermind, i read word by word to see what changed and i see it now

so basically, as explained in the readme, this extension is currently designed to only change the maximum limit concerning the number of columns while keeping the entire, reliable, native GS computation of the layout depending on the available height, the available width, an icon size that makes sense, the pixel density, the aspect ratio, etc.

and your suggestion is to do the opposite instead, by forcing a minimum number of columns regardless of all these variables

sorry but no. I'll never replace my current extension with that, though i agree the _minColumns corresponding to the folders could be optionally set to setting - 1

sfatula commented 4 years ago

I was merely asking to (in addition to the current functionality of your extension), to ALSO allow it to display more in the appfolders. i.e., add an additional capability. I am not able to modify your code to make it do this. So, I merely gave you code I used (actually from someone else) that removes your functionality, but, allows it in a crude manner to give more columns in the appfolders. I was not suggesting at all that you replace your function with the new function, it was merely an example of something that works. If you don't see the appeal to adding an additional capability to your extension or do not wish to take that time, I get it, close it then. They've just really made appfolders less useful by using massive icons and small window sizes in later gnome version.