Printers: use a vector icon for the overlay checkmark.
* The checkmark is a McClintock's icon (Pref icon without the shadow)
This commit is contained in:
parent
8914c88dab
commit
51c4f366c4
@ -9,12 +9,15 @@
|
||||
|
||||
#include "PrinterListView.h"
|
||||
|
||||
#include <Application.h>
|
||||
#include <Bitmap.h>
|
||||
#include <Catalog.h>
|
||||
#include <Directory.h>
|
||||
#include <IconUtils.h>
|
||||
#include <Locale.h>
|
||||
#include <Mime.h>
|
||||
#include <NodeInfo.h>
|
||||
#include <Resources.h>
|
||||
#include <String.h>
|
||||
|
||||
#include "pr_server.h"
|
||||
@ -23,7 +26,7 @@
|
||||
#include "PrintersWindow.h"
|
||||
#include "SpoolFolder.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#undef B_TRANSLATION_CONTEXT
|
||||
#define B_TRANSLATION_CONTEXT "PrinterListView"
|
||||
|
||||
@ -275,7 +278,9 @@ PrinterItem::PrinterItem(PrintersWindow* window, const BDirectory& node,
|
||||
}
|
||||
|
||||
if (sIcon && sIcon->IsValid() && sSelectedIcon == NULL) {
|
||||
BBitmap *checkMark = LoadBitmap("check_mark_icon", 'BBMP');
|
||||
const float checkMarkIconSize = 20.0;
|
||||
BBitmap *checkMark = _LoadVectorIcon("check_mark_icon",
|
||||
checkMarkIconSize);
|
||||
if (checkMark && checkMark->IsValid()) {
|
||||
sSelectedIcon = new BBitmap(rect, B_RGBA32, true);
|
||||
if (sSelectedIcon && sSelectedIcon->IsValid()) {
|
||||
@ -525,3 +530,24 @@ PrinterItem::_GetStringProperty(const char* propName, BString& outString)
|
||||
fNode.ReadAttrString(propName, &outString);
|
||||
}
|
||||
|
||||
|
||||
BBitmap*
|
||||
PrinterItem::_LoadVectorIcon(const char* resourceName, float iconSize)
|
||||
{
|
||||
size_t dataSize;
|
||||
BResources* resources = BApplication::AppResources();
|
||||
const void* data = resources->LoadResource(B_VECTOR_ICON_TYPE,
|
||||
resourceName, &dataSize);
|
||||
|
||||
if (data != NULL){
|
||||
BBitmap *iconBitmap = new BBitmap(BRect(0, 0, iconSize - 1,
|
||||
iconSize - 1), 0, B_RGBA32);
|
||||
if (BIconUtils::GetVectorIcon(
|
||||
reinterpret_cast<const uint8*>(data),
|
||||
dataSize, iconBitmap) == B_OK)
|
||||
return iconBitmap;
|
||||
else
|
||||
delete iconBitmap;
|
||||
};
|
||||
return NULL;
|
||||
}
|
||||
|
@ -97,6 +97,8 @@ public:
|
||||
private:
|
||||
void _GetStringProperty(const char* propName,
|
||||
BString& outString);
|
||||
BBitmap* _LoadVectorIcon(const char* resourceName,
|
||||
float iconSize);
|
||||
|
||||
SpoolFolder* fFolder;
|
||||
BDirectory fNode;
|
||||
|
@ -48,53 +48,19 @@ resource vector_icon {
|
||||
$"0A010A00"
|
||||
};
|
||||
|
||||
resource(102, "check_mark_icon") #'BBMP' archive BBitmap {
|
||||
"_frame" = rect { 0.00000, 0.00000, 15.0000, 19.0000 },
|
||||
"_cspace" = 8200,
|
||||
"_bmflags" = 1,
|
||||
"_rowbytes" = 64,
|
||||
"_data" = array {
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FFFFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00000000FF6666FFFF6666FFFF000000FFFFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00000000FFCBCBFFFF6666FFFF6666FFFF000000FF"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00000000FF0000E4FF0000E4FFCBCBFFFF6666FFFF000000FF"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00000000FF0000E4FF000080FF000080FF000000FFFFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00000000FF0000E4FF0000CBFF000098FF000080FF000000FFFFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00000000FF0000E4FF000080FF000080FF000000FFFFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"000000FF0000E4FF0000CBFF000098FF000080FF000000FFFFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00"
|
||||
$"000000FF0000E4FF000080FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00000000FF6666FFFF6666FFFF6666FFFF000000FFFFFFFF00000000FF"
|
||||
$"0000E4FF0000CBFF000098FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00"
|
||||
$"000000FF6666FFFF6666FFFF6666FFFFCBCBFFFF000000FFFFFFFF00000000FF"
|
||||
$"0000E4FF000080FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"000000FF0000E4FF0000CBFFCBCBFFFF6666FFFF6666FFFF000000FF0000E4FF"
|
||||
$"0000CBFF000098FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00000000FF0000E4FF0000CBFFCBCBFFFF6666FFFF0000E4FF0000CBFF"
|
||||
$"000098FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00000000FF0000E4FF0000CBFFCBCBFFFF6666FFFF0000E4FF0000CBFF"
|
||||
$"000098FF000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00000000FF0000E4FF0000CBFF0000E4FF0000E4FF000080FF"
|
||||
$"000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00000000FF0000E4FF0000CBFF0000E4FF0000E4FF000080FF"
|
||||
$"000080FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00000000FF0000E4FF0000CBFF000098FF000080FF"
|
||||
$"000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00000000FF0000E4FF0000CBFF000098FF000080FF"
|
||||
$"000000FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF0000E4FF000080FF000000FF"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000FF000000FF000000FFFFFFFF00"
|
||||
$"FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00"
|
||||
}
|
||||
resource(102, "check_mark_icon") #'VICN' array {
|
||||
$"6E63696606050004003F038901010200060436AD3DB80EF9B80EF9B6AD3D4A7A"
|
||||
$"DA45B09000E6E6E644ECC8C8D8FB7B7AFFFF6665020006043874A7BA670CBA67"
|
||||
$"0CB874A742C71A4A887700E6E6E644ECC8C8D8FB7B7AFFFF666503DD00000506"
|
||||
$"0CBAAAAAC583B31AC1C3B398BB6CC0ABBD17BD39BA98BF41B941BCF9B44FBD9F"
|
||||
$"20C348B971CE44BA7FCE1EBE3963C95DB694C8BBB5DAC64F200A04BA54CCA6C4"
|
||||
$"A4B733C79EB6CEBD40CC510A04C4A7B733C2BEB4F4C5B4B491C79DB6D10A04BA"
|
||||
$"1AC6C4B55BBED6B8C9BE72BD10C6610A06C4A7B733BA3BCCB1B442C2FFB55BBE"
|
||||
$"D7BA1AC6C5C2BEB4F4060A000100023F8BD10000000000003FA8454500000000"
|
||||
$"000A0100023F8BD10000000000003FA8454500000000000A020101023F8BD100"
|
||||
$"00000000003FA8454500000000000A030102023F8BD10000000000003FA84545"
|
||||
$"00000000000A040103023F8BD10000000000003FA8454500000000000A050104"
|
||||
$"023F8BD10000000000003FA845450000000000"
|
||||
};
|
||||
|
||||
resource(0, "init_icon") #'bits' array {
|
||||
|
Loading…
Reference in New Issue
Block a user