Merlinofchaos told me he'd like a style plugin that allows users to change colors like they can change the colors garland uses. This is a ROUGH patch of that feature. :) But it works. Check out the attached screenshot for an example.
Any advice on improving the code/interface would be much appreciated!
| Comment | File | Size | Author |
|---|---|---|---|
| #42 | color-panels-rc1-456840-42.patch | 38.3 KB | slip |
| #31 | color-panel.jpg | 37.14 KB | bomarmonk |
| #28 | color-panels-456840-28.patch | 38.02 KB | slip |
| #21 | corner-bits2.png | 441 bytes | slip |
| #19 | round.png | 87.97 KB | slip |
Comments
Comment #1
merlinofchaos commentedThis should be done with a behavior, probably in color.js that looks something like this:
Roughly.
Second, we probably shouldn't name it color.js as themes can override javascript files (at least, they can with css files and I think javascript is the same way) and color.js is too generic. Let's name it panels-color.js
I'll have more later, but that's clearly the big messy thing that can be cleaned up.
Comment #2
merlinofchaos commentedInstead of this, we can use CTools CSS caching functions.
We can use ctools_css_clear() when the style settings form is submitted and ctools_css_retrieve() to get the filename and ctools_css_store() if it doesn't come up with a filename. That should cover all of our bases. All we need to do is be sure to come up with a unique ID -- you can look at how the 'rounded corners' style does it, which has to solve the exact same problem.
Comment #3
Ariesto commentedI have not tried this patch yet, but colored panels would be amazing! I will definitely keep an eye on this.
Comment #4
slip commentedAwesome! I'm glad people are excited about this. I've done work to fix the issues merlinofchaos discussed above, but I need to do a bit more. I'll have a new version up ASAP and then start thinking about some more improvements.
Comment #5
mcreature commentedVery cool. Subscribing
Comment #6
simonmd commented+1 Suscribing
Comment #7
servantleader commented+1 Suscribing
Comment #8
mcreature commentedJust wondering if there are any updates for this patch, I know you are probably very busy Slip, just wondering if this will still be moving forward. It Sound really great
Regards, Lowell
Comment #9
drupal-boss commentedThis would be really cool. But how should I use this patch? Where should I copy it? Please give me instructions. Plz plz plz
Comment #10
jasontanner commentedHave you seen this documentation ? http://drupal.org/node/60108
Comment #11
drupal-boss commentedThanx
Comment #12
slip commentedmcreature,
Yeah, I managed to update it to account for merlinofchaos' advice but didn't roll a patch. Then I was studying the best way to be able to make it so we can change to the color of images to do rounded edges and drop shadows etc. But then I got really, really busy. :(
If somebody wants to do some work that would be hugely appreciated :). But I'll try to post the more recent patch soon, and I'm even considering taking a fair amount of time off from work to contribute to the Drupal modules I love, so this would get a lot more attention.
Comment #13
mcreature commentedThanks for your response Slip. Looking forward to the patch if and when you get time to post it.
The extra functionality your working on sounds great. I am not versed with panels enough to help with the patch, but I would certainly be willing to help with testing where I can.
Comment #14
hlykos commented+1 Suscribing
Comment #15
merlinofchaos commentedHey slip, any updates? If you're very busy, could you at least post a patch with your most recent work? It could be valuable if somebody else wants to finish it. =)
Comment #16
slip commentedsorry, yeah, that was lame of me... I'll get it ready for posting right now.
I'm also going to do some more work on it today because things have slowed down a bit.
Comment #17
slip commentedHere's an updated patch mostly addressing merlinofchaos's suggestions and updated to apply to 3.0 beta 4.
Comment #18
bomarmonk commentedSlip, some time ago I fiddled around with transparent, rounded corners for a panel style and eventually made it work. It might give you an idea of an approach you might use: http://drupal.org/node/218960#comment-864840. If you keep the rounded corners transparent, you can change the color of the theme or the panels and still have things match up.
Comment #19
slip commentedHere's the latest patch. It features rounded edges as shown in the screenshot. I haven't cleaned it up too much but thought I'd release it so people wouldn't think I'd abandoned this project. There might be some issues with my original color panels style because I haven't played with that since doing a ton of work, so just stick to rounded corners if you want to play with it. O, and I've only tried it with FF3.
The new code lets plugins specify images and then allow the user to change colors of those images. Only one color in the image is allowed but semi-transparencies + transparencies are possible.
Caching of images and stylesheets needs work. Merlinofchaos or somebody else could probably give me some pointers there in regards to ctools. It'd even be cool if we could use imagecache, but that might be far-fetched.
Anyways, I should post another update soon.
Comment #20
gmasky commentedfollow
Comment #21
slip commentedUgh, just realized the patch doesn't seem to include the png file I'm attaching. Other than that it seems to work. I'll include it in the next patch automatically.
It needs to be copied here:
panels/plugins/styles/color_corners/
Comment #22
bomarmonk commentedSlip, thank you for the patch. I am trying to test, but I'm having trouble applying the patch. I am trying to patch against 6.x-3.0 beta 4, and I've put the patch into my panels module folder. Using the command "patch < color-panels.patch" the patch cannot find the files it's supposed to update. My apologies for my lack of understanding here, but I would really like to try this out. Any help in applying this patch would be appreciated. I would also work with a pre-patched tarball, if you are inclined to post that here. Thanks, Slip.
Comment #23
merlinofchaos commentedHe made it from the modules directory, ont panels; try patch -p1
Comment #24
bomarmonk commentedMerlin, thank you. The -p1 command did the trick for patching with the patch file in the panels module directory.
Comment #25
slip commentedohh, should I make it from inside of panels or is it ok to make it from the modules directory?
bomarmonk, great, thanks for testing! Definitely let me know about any more problems.
Also, I've discovered a bunch of caching issues and I'll release a new version today.
Comment #26
merlinofchaos commentedIt's best generate patches from inside the module directory as most folks are used to using -p0. If it's easier to do it this way it is fine.
I played with this for a few minutes (wanted to do longer but I'm a little too tired to work on something so involved) and on first review, this really spews notice errors. I recommend turning E_NOTICE on (I think you edit bootstrap.inc to do this) and you'll see what I mean. Most of it is unquoted strings in the .inc files but there appeared to be some tests for non-existing variables in display-edit or display-render
Comment #27
bomarmonk commentedIn trying this, my panels admin links vanish from the main dashboard (except for the links under the "By module" page) and the panels page configuration links were missing from here as well. Reverting back to beta solved the problems, so I'm guessing there are some issues to be resolved with this patch. I am using a local install of Drupal with XAMPP on a Windows Vista machine and the rootcandy admin theme, so my install is somewhat unique. I am really looking forward to this functionality in panels, so hopefully the bugs can get ironed out and this can eventually get added to the development branch. I will retest with the next patch.
Comment #28
slip commentedHere's the latest patch. Don't forget to download the PNG from above as well.
bomarmonk, thanks for testing! Your issue is very strange. I'm not sure this patch will address that problem. I guess you could try switching to Garland to eliminate the theme as the culprit. But I'm not sure what the issue is. I'll have to investigate.
merlinofchaos, I'm having trouble finding out how to turn on those messages. I thought that was a php.ini setting ?
Comment #29
bomarmonk commentedI switched to Garland, but I still do not get a panels admin link for adding or listing panels pages. This is with your latest patch. I also get an unsupported operands error when trying to add a new panel page. If I go to http://localhost/mysite/admin/build/panels, I simply get the list of other site-building links. Also, if I try admin/build/panels/settings/panel-page, I cannot get to the settings for panel pages (it just goes to the base site building page that lists the links to other module's settings).
Comment #30
bomarmonk commentedSlip, it appears that I needed to disable the panels module, uninstall the panels module, delete the old panels folder, replace it with the patched version of panels, then enable and reinstall panels. This made the admin links appear in their proper place. I'll give you another update after further testing. I've downloaded the image file to the prescribed location and I'm trying out the styles. Thanks again for working on this.
Comment #31
bomarmonk commentedThe color panel has notched corners at this point. See the attached image.
Comment #32
bomarmonk commentedIt looks like the color panes work really well. I just can't get the rounded corners to look rounded at this point. Is the image you posted earlier the right image?
Comment #33
bomarmonk commentedMaybe related to your earlier comment on caching, it would be nice to be able to save a certain pane or panel style, name it, and then reuse it with other panels or panes.
Comment #34
merlinofchaos commentedbomarmonk: Yes, that's on the list of things that we'll want to do as this feature matures. Probably for a later issue though.
Comment #35
slip commentedbomarmonk, cool, glad you got the colors working. The screenshots are correct. The code successfully changes the colors of rounded edges (for me at least). Are you sure you're using the right style? I've added two. One is called Color Panes and the other is Color rounded edges or something similar.
Comment #36
bomarmonk commentedSlip, I get a notched edge, not a rounded corner. I am using the rounded style and the colors are changed appropriately. It just looks like the old Atari 2600 days with low resolution sprites. It might have to do with the image file. I'll try updating that file. Maybe I saved it incorrectly or something.
Comment #37
slip commentedbomarmonk,
It sounds like GD isn't installed or working properly. Can you run phpinfo() to check if it's enable and which version it is? I'll add some code to the next patch to ensure that it's installed and enabled.
Also, the images would be stored directories inside of sites/default/files/panels_color or wherever your files directory is. Could you check if there are any images in there?
Comment #38
bomarmonk commentedI think that's the problem-- the folders are there, but there aren't any files in them. I'll try to fix this. A warning, as you mentioned, would help people like me to get this working.
Comment #39
slip commentedMerlinofchaos,
I found out how to get those notices to appear. I had to edit includes/common.inc. So, next step will be to fix them.
Comment #40
bomarmonk commentedSlip, my install reports that the GD toolkit "is installed and working properly." The images are generated normally for my theme (which uses the color module). I'll try creating another rounded corner pane and see if I can give you any more information about the trouble I am having.
Comment #41
slip commentedAttached (in the post below... whoops) is the latest patch.
I fixed those php notices merlinofchoas mentioned (think I got'em all) and updated it to rc1.
bomarmonk, I'm not sure what your issue is. Do you have php error reporting turned on? An error message would be helpful. Did you place corner-bits2.png in /panels/plugins/styles/color_corners ? What are the contents of /files/panels_color ? For most of my testing I've been making pages through admin/build/pages but I've also done nodes and I believe mini panels. Any more information would be appreciated!
It'd be nice if somebody else could give it a try?
Comment #42
slip commentedhere's the patch
Comment #43
Daniel A. Beilinson commentedHi! I just install panels-RC1 with your last patch and put png file. I can't see anything new in panels (nothing colors) except this error: file_get_contents(sites/all/modules/panels/panels/js/panels-color.js): failed to open stream: No such file or directory /var/www/apache2/html/includes/locale.inc string 1689.
Could you please attach patched version of RC-1 Panels?
Comment #44
Daniel A. Beilinson commentedSorry, it was my problem. Now i see color panes feature.
Please, attach patched version.
Comment #45
Daniel A. Beilinson commentedI think it'll be very coll, if we can choose corner color. I mean to colors for colored round corners: one for body and one for round corner.
Comment #46
crea commentedsubscribing
Comment #47
digi24 commentedSlip, great patch!
Just a quick note, I can partly confirm the problem posted by bonarmonk. The problem is probably not GD related, because some of the rounded corners work. If I just select rounded corners for a region -> everything is alright. The problems start when I try to nest rounded corners like you did in your screenshot.
If I select rounded corners in different colors for both region and content, the inner corners only work, when "each region" is selected in the container dropdown. Otherwise the corners are broken like in the screenshot.
Also the "color panes" do not seem to apply fill settings.
Comment #48
slip commenteddrupal24,
Yay! thanks for testing.
> Also the "color panes" do not seem to apply fill settings.
What do you mean by fill settings?
Anyways, it's strange that I haven't experienced the rounded problem you two have found. However, the code is a bit messy (as merlinofchaos and I have discussed ;) so I'm going to dedicate a day soon to cleaning it up. I expect to have a new patch by the end of the week, and hopefully I'll either find this problem, or just restructure the code in a more logical, less buggy way.
Comment #49
iva2k commentedsubscribing
Comment #50
digi24 commentedSomething like this (maybe there were some changes in panels?). Just a quick hack to illustrate, what wasn't working, maybe other classes are better.
What do you think about introducing border color for the colored rounded corners?
Comment #51
intyms commentedThank you for nice work !
subscribing....
Comment #52
Courtney.B commentedWhat is the status?
Comment #53
slip commentedI got a bit busy..
The code pretty much needs to be reworked and cleaned so it's on the same level as panels and can be added to the project. I'm assuming Merlin still desires a feature like this. I haven't really had the time to work on this and the most recently attached patch is the latest code I've worked on. I'd still like to work on this, but I'm not sure when so if anybody wants to take over, they're welcome.
Comment #54
slip commentedAlso, please post a message here or send me a private message to let me know if you do decide to start significant work on this so we don't duplicate efforts in the off chance that I start working on it again.
Comment #55
socialnicheguru commentedwould it be possible to integrate with the color picker module? just a thought.
Comment #56
merlinofchaos commentedThanks for the basic work on this, slip.
I just dedicated the last 2 weeks to bringing this one home. I have checked it in, and some of it is in CTools and some of it is in Panels.
If you cvs up CTools and Panels, you can activate the panels stylizer module. Currently it needs a few more styles, which I hope to get from volunteers who are a little better with photoshop than I am.
It also needs some documentation. I'll try to work on that this week.