You are not logged in.

#1 2018-12-17 03:36

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

TDE Battery/Plugged-in icon

Does anyone know why the tray icon for the battery or plugged-in icon shows up different in Trinity despite the fact that the Paper-Q4OS icon theme (used with Debonaire) has quite a few very nice icons already in it? (see the attachment for example)


Attachments:
png battery_icons.png, Size: 109.63 KiB, Downloads: 717

Offline

#2 2018-12-17 08:42

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

Yes, it's a Q4OS issue, we need to make these icons naming correct for Trinity to follow the icon theme. A number of power-save icons should be included in the target theme.
directory:
"/usr/share/icons/<THEME>/<SIZE>/actions/" or "/opt/trinity/share/icons/<THEME>/<SIZE>/actions/"
icons:
laptoppower
laptopbatteryRED
scheme_advanced_powersave
suspend_to_ram
laptopbatteryORANGE
laptopcharge
processor
scheme_power
laptopnobattery
laptopbattery
scheme_powersave

We will check and fix it as soon as possible. If you would go through the Debonaire icons, and copy the corresponding ones into the correct places in the https://github.com/q4os/gui-art/tree/ma … _debonaire directory, it would be helpful too, please see attachment. Anyway, thanks for reporting.

EDIT: edited icons path

Last edited by q4osteam (2018-12-17 08:43)


Attachments:
gz actions.tar.gz, Size: 16.08 KiB, Downloads: 876

Offline

#3 2018-12-18 01:55

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

I'll look through the existing icons. I'm not sure if there is a corresponding icon for each of the ones you listed, but I can create new ones if desired.

Were you wanting me to rename each of the icons or just place them into all of the individual folders in the Guithub repo? Can TDE handle symlinks to svg files or should I just use the png files?

Also, the attachment had some other icons that weren't listed in your post. Were those all ones you wanted work on as well?

Offline

#4 2018-12-18 09:07

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

TDE can handle symbolic links to .svg as well as .png, it would be preferred over duplicating files. So, the best way would be to create symlinks and copy related files they point to into the github repository. If you will create a new icons, it's not needed to create any symlinks.

Jaerrib wrote:

Also, the attachment had some other icons that weren't listed in your post. Were those all ones you wanted work on as well?

They aren't required at the moment, but could be created as well.

Last edited by q4osteam (2018-12-18 09:34)

Offline

#5 2018-12-20 03:38

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

Looking through the images you shared, is it necessary to have the rectangular area on the right side of the various laptop icons? If a different icon were used in place of one of the existing ones, would TDE generate the filled-in green area as an overlay? How is that area defined if a new icon is created with a similar design?

I'm open to renaming some of the power icons that exist to work better with TDE, but I also like the idea of adapting the familiar designs to match the Debonaire theme. Does anyone on the Q4OS team have a clear preference?

Offline

#6 2018-12-20 19:13

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

The icons attached are current "Crystalsvg" icons used by TDE for the system tray. They don't match Debonaire theme quite well. We would only need to pick a corresponding existing icons from Debonaire and symlink it into the "/usr/share/icons/<THEME>/<SIZE>/actions/" under the same name as used by "Crystalsvg". So the icons attached should only be a reference for existing Debonaire icons to be symlinked under the correct name. You are also welcome to create a new icons, if you would prefer that.

Offline

#7 2018-12-21 03:20

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

For the sake of comparison, here are some examples of:

  • the original crystalsvg icons

  • the existing Paper ones that could be symlinked

  • sample icons blending the crystalsvg design in a Paper/Debonaire style

Various battery icon drafts

My question was more theoretical on whether something in the third style would inherit the green battery level that shows in the meter on the right. If it did, and anyone liked those, I would spend more time tweaking them.

More on point, however, is that the battery icons do exist in Paper-Q4OS already, and I am more that happy to set up the symlinks to move that forward this weekend. TDE does seem to use the meter as an indicator with additional orange/red variations for critical battery levels while there are icons in Paper-Q4OS for 4 levels of charge. How could we retain a visible indicator for the power level without the full range of icons and no meter?

Some of the other icons (such as the various power schemes) previously posted don't seem to have a direct correlation to any existing icons in Paper-Q4OS. Those might need to be created, which I would happy to do as well.

Offline

#8 2018-12-21 09:01

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

The third sample looks pretty cool smile Yes, we will check the "tdepowersave" code, if (and how) the charge level could be displayed in the meter for non "Crystalsvg" icons and post back in a couple of days.

Offline

#9 2018-12-22 21:35

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

Did some preliminary work on the various power icons. How are these so far?

a rough draft collection of various power icons

Icon key (left to right):
Row 1: autodimm, button, configure, display
Row 2: laptopbattery, laptopbatteryORANGE, laptopbatteryRED, laptopcharge
Row 3: laptopobattery, laptoppower, processor, scheme_acoustic
Row 4: scheme_advanced_powersave, scheme_power, scheme_powersave, scheme_presentation
Row 5: stand_by, suspend_to_disk, suspend_to_ram, yast

Offline

#10 2018-12-23 19:06

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

Great job, the icons look really cool, we are looking forward to include them into the official Q4OS packages.

The "tdepowersave" source code looks like it should be able to draw the color charge indicator on a whatever icon containing "laptopbattery" or "charge" string in its name, see the code below. It seems, there is no restriction by iconset name in the code. We will make some more testing with the new icons you created and post back.

The code guessed as responsible to draw the meter, see "tdepowersave" package, file "tdepowersave.cpp", line 383:

/*!
 * This function draw the battery-capacity (colored field) to the icon.
 * Here also counted the white pixel in the icon-files. Since the icons are
 * the same and white pixel only in the rectangle of the icon, the white pixel
 * stored in \ref countWhiteIconPixel only one time.
 */
void tdepowersave::drawIcon(){
	kdDebugFuncIn(trace);

	BatteryCollection *primary = hwinfo->getPrimaryBatteries();

	TQImage image = pixmap.convertToImage();
	int w = image.width();
	int h = image.height();
	int x, y;
	countWhiteIconPixel = 0;

	if((pixmap_name.contains("laptopbattery") || pixmap_name.contains("charge")) &&
	    countWhiteIconPixel == 0) {
		for (x = 0; x < w; x++)
			for (y = 0; y < h; y++)
				if(TQColor(image.pixel(x, y)) == TQt::white) countWhiteIconPixel++;
	}

	int c = (countWhiteIconPixel * primary->getRemainingPercent()) / 100;

	if (c > 0) {
		uint ui;
		TQRgb Rgb_set;

		if (hwinfo->getAcAdapter()) {
			Rgb_set = tqRgb(0x00, 0xff, 0x00); //green
		}
		else {
			switch(primary->getBatteryState()) {
				case BAT_CRIT:
				case BAT_LOW:
					Rgb_set = tqRgb(0xff, 0x00, 0x00);//red
					break;
				case BAT_WARN:
					Rgb_set = tqRgb(0xff, 0x55, 0x00); //orange
					break;
				default:
					Rgb_set = tqRgb(0x00, 0xff, 0x00); //green
			}
		}
		if (image.depth() <= 8) {
			ui = image.numColors();
			image.setNumColors(ui + 1);
			image.setColor(ui, Rgb_set);
		}
		ui = 0xff000000 | Rgb_set;

		for (y = h - 1; y >= 0; y--) {
			for (x = 0; x < w ; x++) {
				if(TQColor(image.pixel(x, y)) == TQt::white) {
					image.setPixel(x, y, ui);
					c--;
					if (c <= 0) goto quit;
				}
			}
		}
	}
quit:
	if (isShown()) {
		image = image.smoothScale(width(), height());
	}
	fullIcon.convertFromImage(image);
	setPixmap(fullIcon);

	kdDebugFuncOut(trace);
}

Offline

#11 2019-01-03 01:59

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

Thanks for accepting my icons. I'm looking forward to seeing if the battery icons will function with the level overlay!

On a related note, do you have any other icons you want me to work on?

Offline

#12 2019-01-03 10:53

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

We are now trying to get your powersave icons to work with the TDE battery level indicator. It's a quite exacting task, however some progress is going on. It would be great, if you could keep on creating, or modifying, other Debonaire icons by your choice, it will help to improve the Q4OS design. Most of icons you have already provided should be included in one of a forthcoming Q4OS updates. We want also to adapt some icons from the Papirus iconset https://github.com/PapirusDevelopmentTe … icon-theme . We will post here as soon as we have a specific request, anyway thanks for the great work.

Offline

#13 2019-01-04 02:26

Jaerrib
Member
From: Pennsylvania, USA
Registered: 2018-11-18
Posts: 162
Website

Re: TDE Battery/Plugged-in icon

Thanks for working on the battery level indicator. I certainly wasn't trying to make any additional work for anyone though.

I'll keep looking through the icons to see where the Debonaire theme falls back to Crystal SVG and address those first. I agree that adapting portions of Papirus is a good way to go; there's no sense in reinventing the wheel. The areas that will likely fall short are the icons that tie in with TDE (such as the battery indicators.)

q4osteam wrote:

We are now trying to get your powersave icons to work with the TDE battery level indicator. It's a quite exacting task, however some progress is going on. It would be great, if you could keep on creating, or modifying, other Debonaire icons by your choice, it will help to improve the Q4OS design. Most of icons you have already provided should be included in one of a forthcoming Q4OS updates. We want also to adapt some icons from the Papirus iconset https://github.com/PapirusDevelopmentTe … icon-theme . We will post here as soon as we have a specific request, anyway thanks for the great work.

Offline

#14 2019-01-19 23:27

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,465
Website

Re: TDE Battery/Plugged-in icon

All the new icons are now included in the official Q4OS packages, see https://www.q4os.org/forum/viewtopic.ph … 538#p14538

Offline

Board footer

Powered by FluxBB